Animator behaviour on GameObject


I am completely new to unity/game development and stumbled on a small problem I can’t figure out.

I have a GameObject and I applied a Sprite to it. I gave it 2 Collider’s, circle & box as a tutorial, spaceship 2d from unity. I added a Script to it to let it move.

void FixedUpdate()
	float move = Input.GetAxis("Horizontal");

	rigidbody2D.velocity = new Vector2 (move * maxSpeed, rigidbody2D.velocity.y);

Which moves the GameObject to left or right.

But when I add an Animator I can’t move it anymore. Why does the Animator prevent the moment?

Also I noticed that when I added the Animator is that where I place the GameObject on the scene is not where the GameObject starts when I preview the game? I kind of teleports to the left side of the scene. Like It has a fixed position or something.

I tried using the Animator update mode ‘Animate Physics’ but then I will only move within a few pixels form itself.

Hopefully I am clear enough

Thanks in advance.

thats odd , the animator shouldnt override movement. i think I may have had this problem once though because 3dmax impored without a proper parent. the animator does contain positions for the objects and its children. maybe the animator is relating positions to world space. so here is how i fixed…

create a new empty game object. (if your new, click on the gameobject tab on the very top menu bar). Rename it as whatever name you want to call your object.

drag and drop your actuall object into the new empty.
add your movement scripts to only the newly named empty which represents your object now.

if your animations are reasigning to world space, this would fix the problem. other than that… there is no other reason why an animator would have anything to do with movement!

I hope this works for you.

btw… this technique works well for other weird fbx inport /export setting such as
charaters importing upside down.