Forum Discussion
JeffNik
3 years agoMVP
Photon Fusion multiplayer networking with shared anchors...
I have worked at it all weekend, and I'm having trouble wrapping my head around how to synchronize rigidbody objects over Fusion networking so that multiple players in the same physical room can see the objects in the same place. My confusion is centered on the fact that the physics are run on the server, and Unity requires the physics to be in world space (correct?), so the position data that Fusion sends is in SERVER headset world space. But each client headset in the room has its own unique world space, and the renderer will take the networked position and render the objects in the individual player's world spaces, which will differ from the server. To have all users see the physics objects in the same apparent location, the objects need to be set as children of the spatial anchor (right?) that everyone shares from the Meta cloud server.
Can anyone with Fusion AND shared anchor experience give me an overview of how all that works? Or point me to a shared anchor / Fusion sample project? I understand how to, and have made networked physics interaction apps in VR, where world space discrepancies are irrelevant, but trying to get objects synched into a shared space is racking my brain!
11 Replies
Replies have been turned off for this discussion
- DiddyxplayHonored Guest
Did you figure it out i have the same problem
Actually - I *DID* find a solution that seemed to work decently. I made the actual physics object run only on the server, not parented to anything and made a "ghost/hidden" NetworkTransform networked object that represents the physics object. On the server, in the Fusion fixed update function (cant recall the correct name), I calculate the position of the rigid body relative to the server SpatialAnchor and write that position to the networked ghost object, which gets synched to the client. On the client, also in the fixed update function, I write the synched position from the networked object to the localPosition of a client-side-only object parented to the SpatialAnchor. this client-side-only object contains my visual representation of the physics object.
- DiddyxplayHonored Guest
is it possible to do it without code and only the components i just want a networked ball with physics and a collider that me and my friend can push to each other with the collider we have on are hands
- DiddyxplayHonored Guest
i have already added a networked object, rigidbody, collider and networked rigidbody and have set the interpolation target to the child of the ball but it is not getting networked and the ball is already in the scene i dont know how to get it networked
Are you using passthrough or will you be in full VR, not seeing your real environment? Its simpler in VR, but Im not sure if you can to ot without code... but my hurdle was two people doing the same with a physics ball, but in passthrough, and Im pretty confident you cant do that with just objects and components. If you wanna send me your zipped project I should be able to help you find whats not working.
- DiddyxplayHonored Guest
im doing it in full vr but i cant send the zipped file it says the file type is not supported
- DiddyxplayHonored Guest
here is my google drive with the project https://drive.google.com/file/d/1WzaeQ2NeR8VmnqOZm5Zi-fMp_Ge8flJe/view?usp=sharing
- DiddyxplayHonored Guest
all you have to do is type the app id in the fusionVRManager and the multiplayer should work
Allright - checking it out now.
- DiddyxplayHonored Guest
have you found something yet?
- DiddyxplayHonored Guest
Got it to work?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 7 months ago
- 9 months ago
- 2 years ago
- 3 years ago