Changing player position in animation doesn't work. Why?

HI. While adding changing player position in animation and adding this animation to animator, it cause for canceling player movement by keyboard. Why?

And what I need to do if I want jump scene that when player reach some y axis coordinates and player need to move up and down in y axis with out interruptions of keyboard.

As I understand the problem, I can disable keyboard while been in animation, but it is not a problem. I just adding jump animation to animator with out any connections to other animations, and it is not running at all, but player already is not react for up/down keys, while rotation animations (in other layer) is responding to up/down.

While I removes the changing player position in animation, the problem is disappear, so it is defiantly problem with changing position in animation.

So how I can combine code and animation changing position for player.

Thank you very much for any help.

hm,writing my answer again…

O.K. The easy way resolve this problem is putting player object into parent empty game-object and attach player control script to parent object. while all animations to keep on child-player object. So we are eliminating the crossing between moving player by keyboard/accelerometer and animation.

Hope it would help for new newbies =D like me.

when you hit a key to move it moves the guy but u also set up the animation to work at same time, i know jump can do its own movement so not always have to add move up on the axis for it to work right, but if you want it to move forward and jump at same time would have to also have a position change. write a function or an if statement that will do it as if you were pressing a key but to do it without the need to.

In Animator, provided you have Generic or Humanoid model, All animations can totally define the movement of the player without something like a Character Controller.

For this to work the animations need to be Root Motion, which means basically they move off the spot in your third party Modeller.

Make sure Root Motion is checked in the Animator Component box on the player/model gameobject.

When you define your State Machine (Animator Window), provide parameters and refer to your animations by altering these parameters, which should be added to the Transition Arrows BETWEEN the animation boxes of the State Machine.
In your adjoined script, set these parameters based on your KeyPresses etc and if you use boolean don’t forget to UnSet it after you have finished with it.

Change parameters by referencing the Animator component and using the specific Get/Set functions provided.

//SETUP
    private var playerAnim : Animator;
    
    function Start ()
    {
    	playerAnim = GetComponent(Animator);
    }

//EXAMPLE USAGE - In Update() or other function 
    playerAnim.SetFloat("walkFloat", joystickInput.y);
    playerAnim.SetFloat("turnFloat", joystickInput.x);
     				
    if(joystickInput.y != 0.0 || joystickInput.x != 0.0)
    {
        playerAnim.SetBool("walkBool", true);
    }
    else
    {
        playerAnim.SetBool("walkBool", false);
    }

Above, walkFloat, turnFloat and walkBool are NOT defined in the script. They are exclusively parameters of the Animator.

If you want a transition to not be interruptible, use the ATOMIC flag in the Transition window in Inspector, after clicking the relevant transition.

Do not bake X,Z movement in Import Tab