Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Creating animation stops the player from moving

Discussion in 'Animation' started by Serwin_F, Jul 28, 2021.

  1. Serwin_F

    Serwin_F

    Joined:
    Jun 8, 2019
    Posts:
    1
    Hello there

    So, I have this game I'm working on and I'm trying to add an animation where the player hits below him. In order for the sword not to go outside from the frame I had to resize the canvas while I was working on the sprites. So when I import the animation into unity, I see that the center of the sprite is offset form the sprites of the idle postion, whith the result of the character "jumping" in the air instantly when playing the animation. (That is purely visual, the transform position is not updated).

    Having not found a way to set the anchor point( is that the word? I mean the place that unity uses to calcultate its position relative to the object it's on ) of the sprite at a different point, lower on the object, I thought I could just use the animation editor to edit the position of the object for the duration of the animation. Works like a charm, just had to move the collider up at the same time so that it is not underground.

    BUT now the player won't move, ever, no matter what button I press. He won't even fall if I place him in the air. I haven't added the animation to his moveset, I just created it without providing any means of accessing it, yet it influences the whole thing and stops every moves.

    So two questions here: why god why does this do that? (and how do I fix this? I had to use gitHub to revert to a previous state, even quitting without saving wouldn't solve the non-moving issue)
    And perhaps there exists a simpler solution involving actually changing the anchor point of the sprite. If so, how is this done?

    Thanks to those who'll stop by ;)
     
unityunity