Hi,
I instantiate a 3d character prefab through resource.load as a child to an empty game object (which has the npc script on it).
The reason being, when using CS or Triggers, AC needs a character to move to a marker for instance.
My issue is that the animations are not playing since the animator is on the empty game object.
Is there a way I can set the Animator or the Animator(optional) of the empty gameobject with the values of the child (3d character with the proper animation and avatar)?
Thank you.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I'm afraid I'm not following the reasoning behind it - and the NPC script should typically always be on the root object - but you can set the Animator field to a custom Animator component with this code:
Thank you so much, you solved my problem in a few seconds.
The reasoning is to have dynamic NPCs, with the same triggers/cs but different models.
Thank you again, you're a life saver