Hello,
I’ve got a scenery object with a collider set to trigger attached. I can get the trigger to work for most things but I want to check if a certain object (which isn’t the player) is present within the trigger, I can’t see an obvious way to do this, I’ve tried using selected data on the object but can’t get it to register inside the bounds at all. Can anyone point me in the right direction plz?
1) On Trigger Enter, store the starting object into selected data using a Select Game Objects node (change type Add).
2) On Trigger Exit, remove the starting object from the same selected data (also Select Game Objects node, change type Remove).
In the tigger machine's Starting Object setting you can enable Start By Other to allow starting by other game objects that are not the player - you can further limit this e.g. by name, tag or components.
Also, for selected data, you can use Object Variable components to store them on the Object of the machine.
An alternative would be using Check Shape or Shapecast nodes - but they only operate with basic shapes (e.g. box) and not the actual collider of the game object.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!