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. Dismiss Notice

I have a cs0117 Error

Discussion in 'Getting Started' started by Verdun670, Sep 15, 2023.

  1. Verdun670

    Verdun670

    Joined:
    Sep 9, 2023
    Posts:
    2
    I have been watching this video (
    )
    And Then in the gun script specifically i had a problem called (Assets\Scripts\Weapon\Gun.cs(13,21): error CS0117: 'PlayerShoot' does not contain a definition for 'shootInput')
    And there is the code((
    public class Gun : MonoBehaviour
    {

    [SerializeField] GunData gunData;

    private void Start()
    {
    PlayerShoot.shootInput += Shoot;

    }

    public void Shoot()
    {
    Debug.Log("Harry Maguire");
    }
    }
    ))

    ttt.PNG Please I want anybody to help me fix this cause this is my first game:) uyuy.PNG


    I have the latset version..
     

    Attached Files:

    Last edited: Sep 15, 2023
  2. BABIA_GameStudio

    BABIA_GameStudio

    Joined:
    Mar 31, 2020
    Posts:
    483
    Based on the * on the tabs, it looks like you haven't saved your PlayerShoot class yet. Try saving it, and then make sure you have actually coded it the same as in the video.
     
  3. Verdun670

    Verdun670

    Joined:
    Sep 9, 2023
    Posts:
    2
    Thanks Bro You Really made my Dayyyyyyyy.