Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.19 KB | None | 0 0
  1. float xInput = Input.GetAxis("Horizontal")
  2. float zInput = Input.GetAxis("Vertical");
  3.  
  4. Vector3 dir = new Vector3(xInput, 0, zInput) * movementSpeed;
  5. dir.y = rb.velocity.y;
  6.  
  7. rb.velocity = dir;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement