Player to Face NPC

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
c166
Posts: 37
Joined: Fri Oct 14, 2022 11:08 pm

Player to Face NPC

Post by c166 »

Hey Tony,

I want to make the player and NPC face each other when the conversation starts. I know about the Sequencer (LookAt(listener, speaker, 1); ), and I thought that by placing them in the default sequence/ player sequence that I'd be able to achieve this behavior.
default_sequences.PNG
default_sequences.PNG (23.96 KiB) Viewed 11 times
This worked in the Dialogue Demo Scene, but when I play it in my own scene. Only the NPC rotates to face the player. I am not sure if there is something obvious I am missing? (e.g. a component that needed to be assigned?)

Best Regards,
C
User avatar
Tony Li
Posts: 21633
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player to Face NPC

Post by Tony Li »

Hi,

Make sure player and NPC GameObjects are being used as the speaker and listener. Please see Character GameObject Assignments.

I recommend moving the LookAt() command to the first dialogue entry node in the conversation. This way you won't get unexpected side effects if you involve an additional character in a later node in some conversation.

If you want to have both characters change their rotations immediately to face each other, rather than rotating gradually over 1 second, you can use "LookAt()" without any parameters.
Post Reply