Page 1 of 1

Calling scene objects and functions in Sequence

Posted: Sun Mar 19, 2023 4:53 pm
by Aldurroth
Hay there, I have some scripts I need to turn off and on located on my Player that travels from level to level. Using the Sequence commands I need to turn on and off a "cutscene AI" script and a Navmesh Agent component. What command would be used for this?

Re: Calling scene objects and functions in Sequence

Posted: Sun Mar 19, 2023 9:51 pm
by Tony Li
Hi,

You can do this with the SetEnabled() sequencer command. Example. assuming your player is named "Player":

Code: Select all

SetEnabled(NavMeshAgent, false, Player)
Or, if the player is a dialogue entry node's speaker:

Code: Select all

SetEnabled(NavMeshAgent, false, speaker)
(Use "listener" if the player is the node's listener.)

Or you can add a Dialogue Actor component to your player. Use it to associate it with an actor in your dialogue database such as "Player". Conversations that involve the Player actor as the primary actor or conversant will send OnConversationStart & OnConversation events to the player GameObject. So, in this case, you can add a Dialogue System Events component to the player GameObject to disable and re-enable components as described in the Interaction Tutorial.