SyncTransform for physic objects in Networking

Another question. Do I understand it right, that SyncTransforn component is not working in the combination with physics objects?

We were trying to build a snowball fight experience in VR, but noticed that the new instanced snowballs are not visible for others, if there is a Rigidbody component on it. (After removing Rigidbody the snowballs were visible again).

Is there an another way to sync physics-objects in Networking? It would be so fun :snowman_with_snow:

Original Post on Discord

by user 743203108271816774

You have reached your limit of 2 messages… please try again in a few hours

Networking physics is not really supported at the moment.

Also note that SyncTransform does not automatically spawn the object on all users in the room - if you want to spawn a snowball for all users you need to use syncInstantiate (there’s a similar call on the AssetReference type) - but again: physics networking is not really supported. What you can however do is manually calculate and update the snowballs trajectory and react to it hitting some object

we had another idea - in one of needle samples, there is a cannon object, where you give an impulse to a ball.
If each on the VR player would get a cannon-similar object (via syncInstantiate) and then each time somebody fires - we send an event to all players with the information : which cannon fired, its position and rotation, and maybe impulse-amount, then it should work, right? since we don´t sync the positon of the physic-balls, but create a new ball for each player in their world?

by user 743203108271816774

That could work yes. I think in the case of a snowball fighting game it’s not noticeable anyways if the ball is phyiscally accurate for all instances :wink:

Yes totally, it should just fly in a similar direction :smile:

by user 743203108271816774