Help with collision event triggering multiple times.
I am working on a game in horizon world where players throw rocks to hit NPCs (from unity asset bundles). I am encountering an issue with collision detection where a single rock hit is triggering multiple events.
Here's the setup:
- NPC has a trigger zone
- Player throw rocks at the NPC
- NPC should register a hit when a rock enters the trigger and die after 2 hits
- When NPC dies, it should trigger a single event to move a bridge to the scene
Current behavior:
- Using CodeBlockEntityTrigger to detect rock collisions
- When a rock hits the NPC'c trigger zone, the hit event fires multiple times
- After 2 hits, the bridge move event gets triggered twice
What I've tried
- Using state flags to prevent multiple hit from firing
- Tracking hit processing state with boolean flags
- Using a set to track rocks that have already hit an NPC
Would really appreciate it if you could provide suggestions on how to fix this issue. Thank you
