daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Oct 15th, 2018 57 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. public Rigidbody rb;
  2. public float forwardForce = 2000f;
  3. public float sidewaysForce = 500f;
  4.  
  5. void Start () {
  6.  
  7. }
  8.  
  9. // Update is called once per frame
  10. void FixedUpdate () {
  11.     rb.AddForce(0, 0, forwardForce * Time.deltaTime);
  12.  
  13.     if (Input.GetKey("d")) {
  14.         rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0,);
  15.     }
  16.     if (Input.GetKey("a")) {
  17.        rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0,);
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top