Hi Tony,
I've been looking around on the site but I can't find an answer to this.
I'm trying to have the player LookAt() the NPC when a conversation is started. I could run the command from the sequencer in the dialogue node but since this is a generic camera controller script I would like to have it assigned automatically so I don't need to add it in at every conversation.
I'm trying:
public void OnConversationStart (Transform actor)
{
DialogueManager.PlaySequence(""LookAt(listener))
}
but I get a message saying: "taget is null". Could you tell me how I could feel the transform position of the NPC into that command? Also, this script is on a game object that is a child of the NPC I am trying to get.
Thanks,
Nathan
Sequencer Command in code
Re: Sequencer Command in code
Hi Nathan,
The Dialogue System calls OnConversationStart on both primary participants (actor and conversant), passing it the transform of the other participant. You could bypass the sequencer command and do this:
Or you could use the sequencer command like this:
The second parameter (this.transform) is the "speaker", and the third parameter (other) is the "listener".
The Dialogue System calls OnConversationStart on both primary participants (actor and conversant), passing it the transform of the other participant. You could bypass the sequencer command and do this:
Code: Select all
void OnConversationStart(Transform other)
{
transform.LookAt(other);
}
Code: Select all
void OnConversationStart(Transform other)
{
DialogueManager.PlaySequence("LookAt(listener)", this.transform, other);
}
Re: Sequencer Command in code
The second worked for me!
Thanks again for the speedy response
Thanks again for the speedy response