AnimatorPlay null subject

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Kamotachi
Posts: 44
Joined: Fri Nov 29, 2019 9:03 pm

AnimatorPlay null subject

Post by Kamotachi »

Hi!
I have started a new project and I'm using this Dialogue System again because in my previous game I was very happy using it.

In my previous game the dialogues were between avatars, but in this new game there are 3rd person characters.

The main character is a gameObject called “Player” and has a child object called “sprites”.
This object(sprites) contains the Animator that plays the player's animations.

I am trying to make it do an animation called “surprise”(which is already set in the Animator) from the Sequencer of one of the dialog nodes.

I have tried these ways:
- AnimatorPlay(sprites, surprise);
- AnimatorPlay(“sprites”, surprise);
- AnimatorPlay(Player, surprise);
- AnimatorPlay(GameObject(sprites), surprise);

I have also tried to put a component “DialogueActor” configuring it as Player, to the object sprites, that is who has the animator. and - AnimatorPlay(speaker, surprise);

Anyway it always results in the console as “AnimatorPlay() command: subject is null.

I wonder if it can influence that the player is always present in the scene and is never destroyed. Surely I'm doing something wrong, or I'm missing something.
Kamotachi
Posts: 44
Joined: Fri Nov 29, 2019 9:03 pm

Re: AnimatorPlay null subject

Post by Kamotachi »

OMG, Sorry, this is solved!
I knew it was silly :oops:

I was writing the order inside the AnimatorPlay function backwards.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: AnimatorPlay null subject

Post by Tony Li »

Hi,

Glad you found the issue!
Post Reply