Search Unity

Visual Studio

Discussion in 'Community Learning & Teaching' started by TCBprabhpalvirk, Oct 14, 2022.

  1. TCBprabhpalvirk

    TCBprabhpalvirk

    Joined:
    Oct 14, 2022
    Posts:
    1
    Hi,

    I want to make a FPS game. So I looked on the web and found a tutorial. My game looked the same and the coding, but the coding doesn't work! I use Editor 2021.3.1f1. Please let me know what to do.

    their coding
    upload_2022-10-14_20-26-1.png upload_2022-10-14_20-27-6.png
    My coding
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    Make sure visual studio is linked in preferences - 3rd party tools
     
  3. iLinaza

    iLinaza

    Joined:
    Feb 23, 2019
    Posts:
    23
    Your problem would be how you declare the first variable in your class: PlayerInput. You only typed in the class name, but not the variable name. Once you do that you should update al other playerInput references in your code (PlayerInput vs playerInput).

    Also, whenever you have any problem in your code you should take a look at the Console pane in Unity, it will give you error messages that will help you locate your coding errors.
     
    DevDunk likes this.