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.");
}
}
}