Add NetworkMecanimAnimator at runtime
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Fusion.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Add NetworkMecanimAnimator at runtime
LiamVisionary
2022-08-13 18:11:10
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:
Instantiate player model and parent to player.
Add animator to model
Add network object to model
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.
Comments
NetworkMecanimAnimator is a NetworkBehaviour. Fusion does not support adding NetworkBehaviours to objects at runtime.
LiamVisionary
2022-08-14 18:16:50
Luke_Sta 2022-08-13T19:26:31+00:00
NetworkMecanimAnimator is a NetworkBehaviour. Fusion does not support adding NetworkBehaviours to objects at runtime.
Noted! I've refactored with that in mind and now I'm in the clear. Thank you :)
@Luke_Sta Can we at least replace the animator at runtime in NetworkMecanimAnimator?
zibizz1 2022-08-16T18:25:29+00:00
@Luke_Sta Can we at least replace the animator at runtime in NetworkMecanimAnimator?
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.
Back to top