Hi i am a noob! ok so i have an object collider which i want to have an action when the player is inside, and not while the player is outside of the collider. Thanks for the help in advance!
public BoxCollider object1;
void Start()
{
object1.enabled = false;
}
void OnGUI()
{
}
void TriggerEvent1(Collider other)
{
if (other.gameObject.name == "object1")
{
object1.enabled = true;
}
if (other.gameObject.name != "object1")
{
object1.enabled = false;
}
while(object1.enabled = true)
{
Input.GetKeyDown("e");
print("click");
}
}
2243003–149740–SearchArea.cs (506 Bytes)