Forum rules - please read before posting.

Stoping a Trigger Collider when it comes into contact with a different collider?

Hi there. I have been experimenting with a makeshift line of sight mechanic in a 3D first-person game where I use an "On Enter" trigger to activate specific actions in an NPC. It all seems to work fine for the most part, I've ran into an issue where the trigger goes through walls and activates the ActionList when the NPC is on the other side of a wall. (I know it's not an issue, it's as intended) My question is, is there a way to make the trigger collider stop when it comes into contact with a different collider? - I'm using tags to trigger the NPC ActionList.

As usual, thank you in advance for any help.

Comments

  • You can try using a separate Trigger component on the same object that reacts to objects with a different Tag, but it won't account for the distance.

    Have you tried the Physics: Raycast Action? It allows you to detect objects along a given direction and pass them into GameObject parameters.

    Otherwise, a short script to handle detection may be best.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.