Hello, I was developing a third person controller where the player moves using animation(Root motion).
I want my player to always look forward. here is my current script with nothing useful.
Thanks in advance.
private Animator PlayerAnimation;
private float MoveX;
private float MoveY;
public Transform CamLoc;
public float moveSpeed;
public float rotationSpeed;
public Transform relativeTransform;
void Start()
{
PlayerAnimation = GetComponent<Animator>();
}
void Update()
{
MoveX = Input.GetAxis("Horizontal");
MoveY = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(MoveX, 0, MoveY);
MovePlayer(MoveX, MoveY);
}
void MovePlayer(float movex, float movey)
{
PlayerAnimation.SetFloat("MagX", movex);
PlayerAnimation.SetFloat("MagY", movey);
}