Page 1 of 1

Specify trigger zone when NPC has multiple triggers

Posted: Mon Sep 13, 2021 1:58 pm
by nickg84
Hi everyone,

I'm very new to Unity, but learning fast! I'm not really comfortable with scripting yet (I've been using PlayMaker), so please ELI5. :)

Very simple and probably basic question: Under my Dialogue System Trigger component on my NPC, I have a Bark set to On Trigger Enter. Works great, however, I have multiple trigger colliders inside my NPC (a second is separately used for head turning). The bark appears to be activated by, obviously, all of them. Is there any way to set the bark to activate by a specific trigger when multiple are used by an NPC?

Re: Specify trigger zone when NPC has multiple triggers

Posted: Mon Sep 13, 2021 2:53 pm
by Tony Li
Hi,

You can put your NPC's Dialogue System Trigger on an empty child GameObject that only has a trigger collider. If only the player is allowed to trigger barks on the NPC, set the Dialogue System Trigger's Conditions > Accepted Tags to 'Player' if it's not already set. (This assumes your player GameObject is tagged 'Player'.)

Re: Specify trigger zone when NPC has multiple triggers

Posted: Mon Sep 13, 2021 4:36 pm
by nickg84
Of course it was that simple! Thank you!

Re: Specify trigger zone when NPC has multiple triggers

Posted: Mon Sep 13, 2021 4:37 pm
by Tony Li
Glad to help!