Spawning in multiplayer

Does the spawn block not work, if not why?

Some people who I think could help

@JR01 @Galactian @CodeAlpaca @grazer @00T_Free

3 Likes

To spawn a player in Multiplayer the object needs to be a Shared object (or Player? I’ll check the handbook real quick)

4 Likes

It is shared I’m trying to work on a random generation for a game and it’s not working correctly.

2 Likes

I’m trying to use the spawn block to randomly place trees and rocks and keep them the same on both sides

2 Likes

Based on what your saying, I recommend making the spawn block a shared object. Basically similar what CodeAlpaca was saying.

2 Likes

So you’re spawning objects in and not players. The objects you’re spawning in are Shared?

Also,

  • Note: Shared objects can only be spawned while the network is created, so attempting to Spawn , Emit , or Attach shared objects while disconnected will fail.”

3 Likes

I believe they are I’ll have to check.

2 Likes

They are shared objects

2 Likes

If you’re spawning in these objects before you are connected to the server it will fail. So you could use a Player Counter to a filter, and when it is greater than 1 then the objects can spawn it

3 Likes

Is disconnected the same as connecting or waiting?

2 Likes

Ok just saw this I’ll have to test it

1 Like

I think you must be connected to the network, so waiting does not count. (You can open another tab to add in another player)

2 Likes

Not going to be easily possible in multiplayer. Having too many shared objects causes lag. These objects will have to be shared because you cannot share lists between instances yet.

2 Likes

Here’s an equation for that

(Number of Players) X (Number of Shared Objects) = Bandwidth Used
Also, Multiplayer Handbook

2 Likes

Sharing is not needed most of the time, the game handles everything locally on what is happening.
Sharing just teleports objects to try to match the location of the host game. Almost nothing should really be set to shared, unless for example you are spawning with a random behavior and that random number won’t match between games. So spawning a shared object would help make sure that item is there for both games.

And if you want to spawn players, both the spawner and the player object have to be listed as players. Player is like a shared object, but keyboards only active for the local player object (suppose to, it’s buggy). The player object can only respond to the local players control, which is why spawner will only allow player objects to spawn player objects.

2 Likes