I’m trying to use triggers to open and close a door, and I’m using two different scripts to do so.
Here is my code for the one calling the void:
void OnCollisionEnter(Collision col)
{
if(col.gameObject.name == "Player")
{
if (IsOpen == false)
{
openDoor();
IsOpen = true;
}
if (IsOpen == true)
{
closeDoor();
IsOpen = false;
}
}
}
and here is my code receiving the “call” (haven’t put anything in them yet)
public void openDoor()
{
}
public void closeDoor()
{
}
But I am getting an error where it says “The name ‘open/closeDoor’ does not exist in the current context”. I have looked it up and nothing has solved anything.