What's the point of the foreach loop in Trigger()

I dont get the point that using foreach in Trigger while there is only one dialogue trigger on currentconversant. Even when more methods would be added in the event, one trigger is enough to call all of them. It’s confusing but works fine.

Well I figure it out from the later lecture. One dialogue trigger script responds to only one Action. When the choice option related to different Action, foreach loop makes sense.

1 Like

That’s correct, you can have as many triggers as you want on the GameObject, as they’re identified by their action name.

Unfortunately, a bug in Unity prevents us from having multiple DialogueEvents on the same Gameobject (you won’t be able to link to any bt the first)… You can get around this by putting additional DialogueEvents on child GameObjects.

Privacy & Terms