Unique Actor Instance Animations

AngelDog

  • Posts: 37
I have an actor that acts as a prop, a corpse, with 12 variations. I've gotten to the point of having an attribute pick a random integer that decides what animation the actor has, but obviously, it affects all instances of the actor. Is there a way to make each version of the actor have its own choice of animation? I can create 12 actors for each variation, but I would like to know if it's possible to do this.
beep bop

merrak

  • *
  • Posts: 2738
I don't see why you aren't getting the desired result. How have you set up the code for this?

AngelDog

  • Posts: 37
This is what I have set up so far for the actor, if that's what you mean. I would place multiple of this actor, but what I have makes it so each one is the same animation.
beep bop

merrak

  • *
  • Posts: 2738
Change Corpse to a local attribute, not a game attribute. You also don't need the 'switch animation' code in an 'Updating' event. You can move it to an 'On Creating' since you don't need the animation to be set on each engine tick.

AngelDog

  • Posts: 37
Thank you very much! I haven't really messed with local attributes before, good to know now.
beep bop

merrak

  • *
  • Posts: 2738
Thank you very much! I haven't really messed with local attributes before, good to know now.

You're welcome. If you haven't read the Stencylpedia entry on attributes then it'd be worthwhile to. There's a lot you can do with local attributes to make it easy to customize actors and behaviors.

domagojbulat

  • *
  • Posts: 207
You can simply switch these animations like this