Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rigidbody2d.AddForce Unity Update Problem

Discussion in 'Scripting' started by MadsNoerskov, Mar 5, 2015.

  1. MadsNoerskov

    MadsNoerskov

    Joined:
    Mar 5, 2015
    Posts:
    1
    I just updated my Unity yesterday, and i opened up my project. But i cant play my game now, and i keep getting an error with my "Rigidbody2d.AddForce. Heres my script, and i hope some of you could help me out.


    Code (CSharp):
    1. if (Input.GetKeyDown(KeyCode.Space) && grounded){
    2.             rigidbody2d.AddForce(new Vector3 (0, 1, 0) * jumpForce);
    3.         }