Page 1 of 1

[sequencer] find objects and actor accross scene possible ?

Posted: Sat Nov 14, 2020 8:34 pm
by Strook
Hello ! Im digging into sequences and wanted something really simple like :

Code: Select all

LookAt(Player,1)
This dialogue is triggered from an NPC that is not the player. The player has a dialogue actor component and is set to "Player".
However the Player is on different scene (DontDestroyOnLoad) from the NPC (SceneA).

I tried a lot of thing (this was very helpful btw, https://www.pixelcrushers.com/phpbb/vie ... 274#p20274) however it seems i cannot manage to ever find an object that is on another scene. It work fine when both object are in the same scene (SceneA).

Am i missing something ?
thanks, and sorry for spamming with questions !

Re: [sequencer] find objects and actor accross scene possible ?

Posted: Sat Nov 14, 2020 11:59 pm
by Tony Li
Hi,

The LookAt() sequencer command looks at a GameObject with the specific name (e.g., named exactly "Player"). Or you can specify the special keyword 'speaker' or 'listener' to use the GameObjects that the conversation is using as the speaker or listener.

You probably want to use: LookAt(listener,1)
This will make the speaker (NPC in this case) look at the listener (presumably the player in this case).

See Character GameObject Assignments for details on how to make sure the right GameObjects are used as the speaker and listener.