Basically what I’m trying to do is have it so that when my Player enters the trigger(OnTriggerEnter) to have the Main Camera to follow the player along on the X axis.
I originally had two scripts made, one for the trigger so that if c.name == “Player” to active a function I had in another script attached to the Camera but I failed to as I’m still new to all C# and didn’t really know how. Plus I assumed there was to be an easier way all in the one script.
So currently this is what I have -
public Transform Player;
public GameObject camera;
void OnTriggerEnter(Collider a)
{
/*
transform.position = new Vector3(Player.transform.
position.x,transform.position.y,transform.
position.z);
*/
}