Animation Plays with wrong rotation

I know that this has already been asked multiple times, but I cannot get an answer for this very specific problem I have (at least, this is what I think, comparing it to the other problems).

I’ve made a model with one animation (“walk”). (both the model and the animation created in blender)

I import my model into Unity and I add an animation component to the model, where I choose my walk animation. I preview it at the animation preview window, and everything seems just fine.

Now, I position my model to its starting position, facing to the direction I want it to, and when I push the forwards button it does the animation correctly, but to the wrong direction (while the character moves forwards (as I’ve programmed it to do in my script), the animation plays sideways) and also, it begins doing it from the beginning, while the animation loops (the character moves two steps back instantly and replays the animation from there).

Please note the following important points:

  1. At the animation I created in Blender, the position of the model changes (as in a tutorial I followed for blender animation), it doesn’t stay static with the whole movement being done in one position.
  2. I have parented my model to an empty object which contains all the needed scripts that control the movement of the character, the Character Controller etc.
  3. When I import the model into Unity, (I know that Ζ=Up for Blender while Z=Forward for Unity) it doesn’t have the right rotation, so I rotate it and place it to the initial position. But, once I start the game, it takes the rotation of the animation, even before I move the character so as to let the animation play.

You’ve baked the movement into your animation, it sounds like. When animating, ensure that your model doesn’t actually move from the origin, but that his ‘legs just slide across the ground’. This is for the exact reason that you’re describing. You can’t move a mesh through animation anywhere that is to be interactive. An exception might be in a cutscene, and it’s generally the case when doing motion-capture. Actors can walk around a scene and be represented during a cut-scene moving around as they did IRL with no problems. It’s just when a player wants to control that movement that the animation can’t have additional movement baked in, make sense?

So, for each of your animation frames, move your model back to the origin. It’s safe to move him vertically a bob effect, but don’t translate him on the X/Y (blender) axis.

And, if it wasn’t clear, your animation is turning your model to the angle that it was set to in Blender; you probably need to rotate it by the difference.

Good luck!