Page 1 of 1

AnimatorPlay null subject

Posted: Sat Aug 17, 2024 6:21 pm
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.

Re: AnimatorPlay null subject

Posted: Sat Aug 17, 2024 9:20 pm
by Kamotachi
OMG, Sorry, this is solved!
I knew it was silly :oops:

I was writing the order inside the AnimatorPlay function backwards.

Re: AnimatorPlay null subject

Posted: Sat Aug 17, 2024 10:04 pm
by Tony Li
Hi,

Glad you found the issue!