Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Help this script doesnt work

Discussion in 'Scripting' started by D_L, Apr 6, 2015.

  1. D_L

    D_L

    Joined:
    Apr 5, 2015
    Posts:
    1
    if (Input.GetKeyDown(KeyCode.Space) && isFalling == false)
    (
    rigidbody.velocity.y = jumpHeight;
    isFalling = true;
    )
    )

    functionOnCollisionStay ()
    {
    isFalling = false;
    }
     
  2. Galf

    Galf

    Joined:
    Feb 24, 2013
    Posts:
    27
    I think you are using parantheses where you should be using brackets, and then have an additional paren beyond that.

    Try:
    Code (CSharp):
    1. if (...)
    2. {
    3.   rigidbody...
    4.   isFalling...
    5. }