Search Unity

Discussion jumpForce not recognized in Microsoft Visual Studio and not Showing in my Version of Unity

Discussion in 'Getting Started' started by kautif, Apr 18, 2023.

  1. kautif

    kautif

    Joined:
    Apr 11, 2023
    Posts:
    4
    Hello. I'm following along with a simple platformer tutorial and they're making their character jump. They multiply a value by jumpForce. For them, it doesn't throw an error in Unity and it is a variable they can change the value for in Unity. Their Unity version is 2021.3.0f1.

    In my case, when I try to use jumpForce, Unity says "Error CS0103 The name 'jumpForce' does not exist in the current context" and is not a variable that shows in my version of Unity. My Unity version is 2021.3.22f1

    Please help me figure out how to get jumpForce to be recognized in Microsoft Visual Studio and Unity. Thanks. Oh and I'm using Microsoft Visual Studio Community 2022 (64-bit) Version 17.5.3. Thanks.
     
  2. CanYourGameGoViral

    CanYourGameGoViral

    Joined:
    Apr 15, 2023
    Posts:
    9
    I assume jumpForce is a variable, either a class variable or a method variable.
    Just write this right at the beginning of your class:
    Code (CSharp):
    1. public float jumpForce = 10f;
    It should work.
     
    kautif likes this.
  3. kautif

    kautif

    Joined:
    Apr 11, 2023
    Posts:
    4
    Interesting... yea that was it. Okay. Thanks for your help
     

    Attached Files:

  4. kautif

    kautif

    Joined:
    Apr 11, 2023
    Posts:
    4
    Disregard the screenshots