Good day everybody!
I have a question about the correct logic for the next trigger:
In case A (image below):
The trigger in the scene is enabling light each time the player enters the trigger. There're several triggers and they all do the same - enable light when OnTriggerEnter() is called.
In case B:
This is a bug that I have: the trigger enables light each time the player enters the trigger, BUT when the player decides to go back and re-enter the same trigger the NEXT light would be enabled and I don't want that.
The light is enabled by order. Each time a method is called the NEXT light is enabled. Very fast I get "index out of range" error.
![alt text][1]
**How can I tell the script to only execute the function once if the the same trigger has been re-entered?**
Thank you!
[1]: /storage/temp/138978-question-about-triggers.png
↧