#SpawnWithOwnership on a gameobject with a NetworkAnimator OnIsServerAuthoritative = false

1 messages · Page 1 of 1 (latest)

sturdy jetty
#

When Spawning a networked game object with Ownership, it is correctly spawning it by setting the client as Owner. But the animator get's an issue.

The networked object has a OwnerNetworkAnimator (OnIsServerAuthoritative = false) with a child gameobject, having an Animator attached to it,

Even when checking if IsOwner before doing animator.SetFloat,

It returns Only the owner can invoke a ServerRpc that requires ownership!

Is there something i'm missing ?

It's for a companion that will follow player around without any real interaction.
I wanted to optimize and reduce the script part from the host. So transform the companion to client side.
I'm just syncing the transform position and animation.

steady pond
#

Is this error coming from the Network Animator? I didn't think it used RPCs. Also when are you setting the animator float? Is the network transform also set to owner authority?

sturdy jetty
#

The code is as simple as this, if I comment the animator.SetFloat, the error is gone properly

WHen I inspect the gameobject, the NetworkObject has IsOwner set to true. (The child gameobject with Animator doesn't have anything else attached to itself)

steady pond
#

What version of NGO are you using? It might be because IsOwner might not be set immediately on spawn. But sounds like a bug either way