Hi, I’m trying to get a third person controller to work that turns into the the direction of the camera while aiming, like in GTA V. I’m using the Easy Character Movement Asset from the asset store. The problem with my code is that the character is moving constantly forward as he turns. I hope somebody can help me, that is my input code:
moveDirection = new Vector3
{
x = Input.GetAxisRaw(“Horizontal”),
y = 0.0f,
z = Input.GetAxisRaw(“Vertical”)
};
walk = Input.GetButton("Fire3");
jump = Input.GetButton("Jump");
crouch = Input.GetKey(KeyCode.C);
float singleStep = angularSpeed * Time.deltaTime;
moveDirection = moveDirection.relativeTo(playerCamera);
moveDirection = Vector3.RotateTowards(moveDirection,playerCamera.forward,singleStep,1.0f);