Forum rules - please read before posting.

Triggers - Any way to have one trigger do something on enter and exit?

edited June 2020 in Technical Q&A

Unity ver: 2019.2.4f1
AC ver: 1.71.4

Hello adventure friends,

Is there any clever way to have a single trigger run an action list on player enter, and a different action list on player exit?

By the look of the trigger type properties, a single trigger can only do one thing. However if a single trigger could somehow handle both that would occasionally save needing to put lots of multiple triggers into a scene.

Comments

  • Add another trigger component to the trigger game object and set on exit. This way you can have two different actionlists on the same game object. The only downside is that you can't edit (or at least I can't) actionlists on the actionlist editor, but you can add actions below the trigger in Inspector menu.

  • The Demo game's Basement scene has two Triggers attached to its SwitchNavCam object to do just this.

    If multiple ActionLists are attached to a single GameObject, clicking the "node" icon beside its name in the Hierarchy will bring up only the first in the ActionList Editor. However, you can click the "ActionList Editor" button in the component's Inspector to bring it up for that specific ActionList.

  • edited June 2020

    Brilliant. Works great. That's a really powerful bit of learning, thanks.

    A bit of UX feedback @ChrisIceBox. Could the action list editor buttons have a colour? I think that would really help lift them out of very busy inspectors. Took my eyes a while to find them in amongst all the other same coloured buttons!

  • You could also just fold the top AC_Trigger with the arrow button, then it's easier to find the next component :smile:

  • I personally prefer to disable Action display in the Inspector (via the Actions Manager) so that they're only editable in the ActionList Editor window. Doing so also enlarges the "ActionList Editor" and "Run now" buttons.

  • Perfect.

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.