I am making a mobile game and everything is working but the character rotation.
I got the movement code which uses the Unity Standard Assets joystick to move the character around.
vertical = CrossPlatformInputManager.GetAxisRaw ("Vertical");
horizontal = CrossPlatformInputManager.GetAxisRaw ("Horizontal");
Vector3 playermovement = new Vector3 (horizontal,player.position.y*0f, vertical);
playerbody.AddForce (playermovement*speed);
This works great and the player is moving in the exact position I go with the mobile joystick but I want the player to also rotate in the direction it’s going on the Y axis. For example to rotate right and left etc…
I tried messing around with quaternions but I cannot get it to work…