Hello,
I'm loving triggers. Currently, they can be set to detect a singluar object. It would be great if there was extended functionality to handle multiple objects in the following ways:
• Run if any of set objects are detected
• Run when all set objects are detected
Thanks!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
A Trigger's Trigger detects field can be set to Any Object With Tag, which will cause it to run whenever an object with a specific tag enters it.
Having a Trigger run when all types of a given object opens up room for complication and interpretation, though. If it was a one-off, one approach you could take would be to increase an Integer variable by 1 each time a Trigger is entered, and subtract 1 when exited. If the variable reaches a given value, then run a separate ActionList to actually perform what you want.
The concept of a Trigger is very common to working with Unity, however. It's essentially using OnTriggerEnter calls to check if a given target is inside it, and runs an ActionList if so. You could easily script a separate Trigger type that does this but also requires that multiple targets are inside it.
To run a separate ActionList through script, you just need to call its Interact() method.