Can I make a GameObject a syncField()

Hello Everyone, Hope all doing well.

I have a silly doubt, pardon me. I was just wondering can I have a GameObject syncField like below:

@syncField()
lastSpawnPoint?: GameObject | null;

This is a gameobject synced across all the network players.

Original Post on Discord

by user 389863047159873540

Hey :wave: There’s a chance that in your usecase the gameobject won’t have the same guid.

What is your usecase?

Can you define all possible spawnspots in an array and then sync index to the adequate game object?

Random Spawn Point. I want to make sure that new users who joins room dont spawn where some other user already spawned and standing idle

by user 389863047159873540

You should be able to synchronize a vector: world position of a safe spawn.

Hi, the syncField can not synchronize a Object3D / GameObject but as Kipash said you can send a Vector3 if you only care about the position

If you have a list of spawnpoints you could also sync the index only

great! that will help. Thanks :slightly_smiling_face:

by user 389863047159873540