Search Unity

Assets/Scripts/PlayerMotor.cs(40,12): error CS0106: The modifier 'public' is not valid for this item

Discussion in 'Scripting' started by Smol_1, May 17, 2022.

  1. Smol_1

    Smol_1

    Joined:
    Apr 26, 2021
    Posts:
    4
    I'm new to coding and am finding a lot of errors, but one that I can't find a fix for is CS0106. The code with the error is Screen Shot 2022-05-17 at 12.39.14 AM.png and it's affecting both line 40 and 46.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You have defined Crouch and Sprint inside your Update method. Why do you have crouchTimer / 1 ?
     
    Bunny83 likes this.