Forum rules - please read before posting.

How to change player position during a specific animation?

Hi,

I'm trying to change character's x position during a custom animation (2d, sprites unity complex). When played through the animation window the sprite moves & animates fine but in game only the animation plays and player's x won't budge... What could I be doing wrong? I dropped the player prefab in the scene and dragged it slightly to the side while the animation was recording - probably not the best method ;) but the only one I could think of.

Please help ;)

Comments

  • AC controls the position of your character's root object at all times.  If you change the position through animation, you can only do it by manipulating the sprite child - however you will also need to reset the position back to (0,0,0) once the animation is complete, as this new position will be in appearance only (the character's "true" position will be unchanged).

    If you want to control the character's true position, better to use the Object: Transform Action midway through the animation.
  • Does that mean that my character will need Moveable component?
  • My apologies - I meant Object: Teleport.  He will need no other component with that.
  • Thanks, Chris. I used Object: Transform during the animation, then found the sprite child indeed got relocated during the process so ended up having to teleport player in place and reset its position.

    It was all kinda fiddly, but the result is great ;) Coming from AGS background I find often that things that were incredibly easy to do in AGS are overly complicated in Unity (like playing sound on specific animation frame; but I got that figured out in the end), and vice versa ;) Still, it's worth the effort, and I'm enjoying it a lot ;)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.