oculus-samples / Unity-Movement

Body, Eye and Face Tracking code sample.
Other
267 stars 45 forks source link

Not working for multiplayer #86

Open smittenz opened 1 week ago

smittenz commented 1 week ago

If I set the movement enabled player to a networked player prefab once it is instantiated the tracking turns off I get these errors when manually attempting to allow these scripts to. [OVRBody] Failed to start body tracking with joint set FullBody. UnityEngine.Debug:LogWarning (object) OVRBody:StartBodyTracking () (at ./Library/PackageCache/com.meta.xr.sdk.core@67.0.0/Scripts/Movement/OVRBody.cs:126) OVRBody:OnEnable () (at ./Library/PackageCache/com.meta.xr.sdk.core@67.0.0/Scripts/Movement/OVRBody.cs:95) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

luffy-yu commented 19 hours ago

I have figured out a solution to make it support multiplayer.

The basic idea refers to the Building Blocks multiplayer implementation based on Unity.Netcode.

FYI, I have attached the source files.

MovementMultiplayer.zip

Apply changes to the HighFidelityFirstPerson prefab. 2024-09-23_131113

BTW, you may need a simple network manager.

smittenz commented 18 hours ago

I can't begin to express how much I appreciate this you are a real life saver! thank you so so much!!

On Mon, Sep 23, 2024 at 1:20 PM Liuchuan Yu @.***> wrote:

I have figured out a solution to make it support multiplayer.

The basic idea refers to the Building Blocks multiplayer implementation based on Unity.Netcode.

FYI, I have attached the source files.

MovementMultiplayer.zip https://github.com/user-attachments/files/17101348/MovementMultiplayer.zip

Apply changes to the HighFidelityFirstPerson prefab. 2024-09-23_131113.png (view on web) https://github.com/user-attachments/assets/28dc5114-2c01-4e6a-b2a3-0a8cf7e462b8

BTW, you may need a simple network manager https://docs-multiplayer.unity3d.com/netcode/current/tutorials/get-started-ngo/#create-the-networkmanager-component .

— Reply to this email directly, view it on GitHub https://github.com/oculus-samples/Unity-Movement/issues/86#issuecomment-2368902142, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4H6ZKLZQAMVEPQFZDNJWYTZYBEVNAVCNFSM6AAAAABOIEI3AWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYHEYDEMJUGI . You are receiving this because you authored the thread.Message ID: @.***>

luffy-yu commented 17 hours ago

@smittenz You are welcome! I'm glad it helps.

smittenz commented 12 hours ago

to clarify, are these scripts compatible with other OVR movement bodies? does the network avatar data stream have to be placed in the scene, and are the player prefabs spawned through the network lobby building block or the shares avatars building block? thanks again!

On Mon, Sep 23, 2024 at 2:53 PM Soph Katsivelos @.***> wrote:

I can't begin to express how much I appreciate this you are a real life saver! thank you so so much!!

On Mon, Sep 23, 2024 at 1:20 PM Liuchuan Yu @.***> wrote:

I have figured out a solution to make it support multiplayer.

The basic idea refers to the Building Blocks multiplayer implementation based on Unity.Netcode.

FYI, I have attached the source files.

MovementMultiplayer.zip https://github.com/user-attachments/files/17101348/MovementMultiplayer.zip

Apply changes to the HighFidelityFirstPerson prefab. 2024-09-23_131113.png (view on web) https://github.com/user-attachments/assets/28dc5114-2c01-4e6a-b2a3-0a8cf7e462b8

BTW, you may need a simple network manager https://docs-multiplayer.unity3d.com/netcode/current/tutorials/get-started-ngo/#create-the-networkmanager-component .

— Reply to this email directly, view it on GitHub https://github.com/oculus-samples/Unity-Movement/issues/86#issuecomment-2368902142, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4H6ZKLZQAMVEPQFZDNJWYTZYBEVNAVCNFSM6AAAAABOIEI3AWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYHEYDEMJUGI . You are receiving this because you authored the thread.Message ID: @.***>

luffy-yu commented 11 hours ago

@smittenz The core change is the NetworkOVRBody class, which substitutes the original OVRBody class. All other classes are to support the NetworkOVRBody class. It means as long as the original game object has an OVRBody component, it can be simply replaced with the NetworkOVRBody class to enable multiplayer.