Question by
AlJuadeen · Nov 11, 2016 at 08:33 AM ·
rotationplayer movement
Problem with rotation on a player controller
Hi, i m doing a simple game for fun, a third person shooting game. The way i move my player is like this:
public Rigidbody rb;
public float speed = 0.5f;
void Start () {
rb = GetComponent<Rigidbody>();
}
void FixedUpdate () {
float moveHorizontal = Input.GetAxis ("Horizontal") * speed;
float moveVertical = Input.GetAxis ("Vertical") * speed;
movement = new Vector3 (moveHorizontal, rb.velocity.y, moveVertical);
rb.velocity = movement;
}
For now, everything is working good, but when i want to rotate my player, i dont really know how to do it by reading the axis (i know i can do it by using a getkeydown, but i want to use the axis). Thanks!
Comment
Your answer
Follow this Question
Related Questions
How to make character movement track users head rotation 0 Answers
Rotate player based on custom axis 0 Answers
Smooth Rotation on WASD keys pressed? 1 Answer
Rotate ball in camera's direction.... 0 Answers
I use click to move, but don't want my player to rotate... How to fix this rotation? 1 Answer