Add NetworkMecanimAnimator at runtime
Is there some special set of steps that needs to be followed to get the network mecanim animator to work when added to an object at runtime? I've done the following:
1) Instantiate player model and parent to player.
2) Add animator to model
3) Add network object to model
4) Add NetworkMecanimAnimator to model
, but it seems there is a missing pointer or something as I get an error when adding the animator, and another when trying to trigger animations.
In the inspector, I see the NMA auto-retrieves the correct unity animator, so I'm not sure why it's throwing errors.
Answers
-
NetworkMecanimAnimator is a NetworkBehaviour. Fusion does not support adding NetworkBehaviours to objects at runtime.
0 -
Noted! I've refactored with that in mind and now I'm in the clear. Thank you :)
0 -
I think that should work but I have never tried it. I'd recommend to replace the animator in Spawn immediately when the object is spawned.
0