#so i was trying to spawn objects as the

1 messages · Page 1 of 1 (latest)

north sluice
#

Check for any console errors. You'll need to make sure that this is only getting called after OnNetworkSpawn().

lime osprey
#

i got an error because for server rpc i need ownership so i changed it to RequireOwnership = false

#

now no errors, so idk what's wrong

north sluice
#

Make sure that this is in a network behavior and that the network object is spawned

lime osprey
#

@north sluice maybe it's because it's not on the player itself but on a planet? (on planets on the map you can spawn ships) that's why it said i don't have ownership too

north sluice
lime osprey
#

So idk why :(

north sluice
#

So the RPC is not getting called at all?

#

Also your while loop there is going to be infinite when it does get called. Spawned is only getting set true on the server and not the client. You would need to make it a network variable if you need that value symced

lime osprey
north sluice
#

When is the coroutine getting called? Is should be called in OnNetworkSpawn or later

lime osprey
#

the function serverrpc is on completely doesn't do anything

north sluice
#

If the runs too early, the serverRPC will do nothing since the object is not on the network yet

lime osprey
north sluice
#

Ok, does the planet have a network object?

lime osprey
#

yes

#

the client spawn debug works

#

but not the spawn finished

#

and no errors

north sluice
#

If the network obect has been spawned and this in in a network behavior then there is no reason a serverRPC won't run

lime osprey
#

🤷🏻

lime osprey
#

@north sluice also, [SyncVar] doesn't work / couldn't be found

north sluice
lime osprey
#

kk

lime osprey
#

@north sluice so, it seems like the planet's network object where the script is on is not working. on start of the game it doesn't spawn. and if i do manually i get this

#

(when spawning the network object)

north sluice
north sluice
#

That should work too. If the planets are in that scene and enabled then they be spawned

lime osprey
#

that's how it looks on start

lime osprey
north sluice
#

Weird. Try moving network object up to the top. Though that shouldn't matter anymore

lime osprey
#

oh wait it worked now,

#

i removed,

#

a network object from the scene

#

that was a network prefab

#

(not the planet)

#

for some reason they had the same Id

#

weird

north sluice
#

Huh, that should have given an error message

lime osprey
#

in game dev. i always think either i am dumb or unity is. most of the time it's both

#

xD

lime osprey