Quantcast
Channel: Answers for "Make a rigidbody Jump (global up)"
Viewing all articles
Browse latest Browse all 7

Answer by XenoTracker

$
0
0
Apparently this is the new AddForce thing Public float jumpSpeed = 5f;//or whatever you want it to be public Rigidbody rb; //and again, whatever you want to call it void Start (){ rb = GetComponent (); } Void FixedUpdate(){ if(Input.GetKey (KeyCode.Space)){ rb.AddForce(Vector3.up * jumpSpeed); } } and in the inspector just drag the Player game object from the hierarchy to the rb slot in the script and you're good :3

Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images