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?
  • Just to clarify what I’ve trying to do: I need one game object to be able to read some variables off a different object, neither of which are the player, what’s the best way to do this?
  • edited November 2021
    If you want to check for things within the collider of a game object, I'd recommend using 2 Trigger Machines.

    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.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks, I’ll give it a try
Sign In or Register to comment.