#"Only server can spawn NetworkObjects" when attempting to spawn object through Rpc(SendTo.Server)
1 messages · Page 1 of 1 (latest)
is this script a valid NetworkBehaviour at the time you call this RPC?
- has a NetworkObject attached to it
- is Spawned at the time of calling the RPC
- the script inherits from NetworkBehaviour
this class gets instantiated and added to a list declared in a NetworkObject
i don't believe the class itself is spawned, but the object holding it certainly is
and they both inherit NetworkBehaviour yeah
The network behavior needs to be on the network object when it has been spawned. You can not add one after it has been spawned
even if the networkbehavior isn't a component?
i have it added to a dictionary inside a script that is already on the object before its spawned
Network Behaviors have to be a component.
you could add it as a child object to the main game object before it spawns though
ahhh i see