Advertisement
mew_fi

Lateral and vertical acceleration

Dec 13th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1. moveY = myTransform.up * Input.GetAxisRaw("Jump");
  2. moveZ = myTransform.forward * Input.GetAxisRaw("Vertical");
  3. m_body.AddForce((moveY + moveZ) * thrustPower);
  4. // Use (moveY + moveZ).normalized if you want to always have the same thrust force.
  5. // I prefer the style of having a higher thrust force when using both movement keys.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement