I have a prefab which is used in various places in the world of the game. It has an event interaction in it. I want to be able to destroy this prefab as soon as that event is finished. I have not been able to find a way yet. Also I cannot just call destroy prefab as it will also destroy all other instances of this prefab.

Is there a way to do so in the event itself?

Thank you
  • The Event Interaction has the Deactivate After Event option - it'll disable the game object (not destroy it) after the event.

    Otherwise, you can use a Destroy Object node to destroy the event's game object, set up an actor for the event object in that case (Object actor type, enable Event Object).

    Also, you can access individual instances of a prefab (spawned by the event) via the Spawned Prefab ID, -1 uses all spawned instances, 0 the first, 1 the 2nd, etc.
    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!
  • Thank you for the response will try!
Sign In or Register to comment.