Mecanim Issues: Root motion not being applied, and weapon is out of place

So I never got to really mess with animations till now (My first time doing this stuff)

I wanted some basic stuff like idle, running, walking and aiming. I couldn’t really find a good aim animation anywhere (I’m no animator) - The only thing I liked was the character from the Locomotion system.

From there, the animations were all imported as separate .fbx files - they were all Legacy so I turned them into Humanoid. I dragged the animations I wanted and so here is my state machine:

The animations are transitioning correctly, here’s what’s controlling them:

using UnityEngine;

public class MecanimTestController : MonoBehaviour
	public float rotationSpeed = 1f;

	void Update()
		var animator = GetComponent<Animator>();
		if (animator)
			animator.SetFloat("Speed", Input.GetAxis("Vertical"));
			animator.SetBool("IsAiming", Input.GetMouseButton(1));
			animator.SetBool("IsRunning", Input.GetKey(KeyCode.LeftShift));
		transform.Rotate(0, Input.GetAxis("Horizontal") * Time.deltaTime * rotationSpeed * 100f, 0);

The problem I’m having though is that the character doesn’t move even though “Apply root motion” is ticked. He doesn’t even more when I preview the animation! (at the bottom right corner of the animation) - Also, the guns are always out of place. Here’s a small video highlighting the problems, showing my avatar settings, import settings, etc. - Please give it a view.

Question is: Why isn’t root motion being applied? (why isn’t the character moving) and why is the gun being offset-ted?

Thanks for any help!

The guns can be kept in place by making it the child of the hand and ammo quaver, and the character can be moved with script by doing

if (animator.GetCurrentAnimatorStateInfo(0).IsName("Base.RunForward"))

Base. being the first layer, and RunForward being the state name, and if it’s true you can do what the root motion was supposed to do.

Root Motion only works ‘as-is’ when the Animation moves from the spot in the Animation tool/ Modeller.

Otherwise, you may very well need this function