#Hey, i am trying to get the local player

1 messages · Page 1 of 1 (latest)

inner island
#

If this is code that's being run on the player object, why do you need NetworkManager.Singleton.LocalClient?

limpid grotto
#

The host is spawing an nother object and in that object as well, the PlayerObject is null

#

so that is why i am saving the local player to a static variable

#

Also, how is the best method to spawn list of objects in batches? rn i am spawing them in a forloop and i get a warning cause of that

inner island
limpid grotto
inner island
#

I would also run base.OnNetworkSpawn() first.

#

I'm not sure if there's any actual setup in it, but there could be. So best to run it first.

inner island
limpid grotto
#

wdym pool?

inner island
#

What object are you trying to spawn in batches for your game?

limpid grotto
#

when the host joins he spawns the map, cause is random chosen and the enemies

#

and i get that warning when spawing the enemies

#

i was thinking maybe doing a QUEUE and spawn x number on the update method

#

instead of all of them

inner island
#

If you're going to be spawning enemies every single game, it would make sense to just have them placed in scene already. Then just randomly change their type or any customization at runtime

limpid grotto
#

There are a different enemy prefabs depending on the map and so on, so that will be kind of complicated 😅

inner island
#

If there are more similarities than differences between your enemy prefabs, it's something I would recommend doing