Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float xInput = Input.GetAxis("Horizontal")
- float zInput = Input.GetAxis("Vertical");
- Vector3 dir = new Vector3(xInput, 0, zInput) * movementSpeed;
- dir.y = rb.velocity.y;
- rb.velocity = dir;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement