Problem with a script

Gamer To Game Developer course.

Hi guys i have a odd problem that i can’t see to fix when watching the course.

Member modifier public must precede the member type and name.

using UnityEngine;
using System.Collections;SetInitialRefences

   public class TriggerExample : MonoBehaviour {

    private WalkTroughWall walkTroughWallScript;
   
    void Start()
    {
        SetInitialRefences();
    }


    void OnTriggerEnter(Collider other)
    {
        //Debug.Log(other.name + " has entered");
        walkTroughWallScript.SetLayerNotSolid();
    }

    void OnTriggerExit(Collider other)
    {
        //Debug.Log(other.name + " has exited");
        walkTroughWallScript.SetLayerToDefault();
    }

    //void OnTriggerStay(Collider other)
    //{
    //    //Debug.Log(other.name + " is in the trigger");
    //}

    void SetInitialRefences()
    {
        if(GameObject.Find("Wall")!= null)
        {
            walkTroughWallScript = GameObject.Find("Wall").GetComponent<WalkTroughWall>();
        }
        else
        {
            Debug.Log("Object is net setup right.");
        }
       
    }
}

using System.Collections;SetInitialRefences

Try delete SetInitialRefences

1 Like

Thank u so much seems like i have a lot to learn when it comes to reading errors :slight_smile: