HasEnteredTrigger Not Working

petjeennetje

New member
Hi,

I am trying to make the HasEnteredTrigger work, and even went as far to copy your example that you posted on the forum in the past. But even with the example, it never seems to trigger. Am I missing something?
1714047646537.png
1714047654853.png
1714047677921.png
1714047692990.png
 
Last edited:
What object is your behavior tree on? In this case it should be on your camera since that will receive OnTriggerEnter. I just tested a similar setup and it worked (example attached).
 

Attachments

  • trigger.unitypackage
    4.1 KB · Views: 0
What object is your behavior tree on? In this case it should be on your camera since that will receive OnTriggerEnter. I just tested a similar setup and it worked (example attached).
Hi Justin,
Both objects do not have the behavior tree on, the behavior tree is on a character, and I want the character to behave differently depending if a specific object is inside or outside the area.

To give more context:
There is a house in the scene, and a way for players to place cameras, I want the NPC to behave differently depending if the player placed the camera inside or outside the house.
 
Last edited:
Has Entered Trigger will only trigger when the GameObject with the behavior tree enters the trigger. For that use case I would create a different script that sets a SharedVariable or sends an event depending on if the object is in the trigger.
 
Top