Custom NetworkObject Position #431
Replies: 3 comments
-
I'm not sure I am following this requests. You could put a NT on the object to synchronize the position, it won't send data if it does not change. You can also move the NOB on the server and it will send the changes in the spawn packet. |
Beta Was this translation helpful? Give feedback.
-
I'm talking about the compatibility of this particular setup with built-in observer conditions like Distance Condition and Grid Condition where they check nob's position. This particular setup of multiple NTs under a NOB is fairly common for VR applications since there are more than one player objects (body, head and hands), which is incompatible with the built-in conditions. Putting a NT on the root NOB doesn't do anything simply because it does not move with the player. This could easily be solved with custom conditions tho. I just feel like that the Grid Condition might be a bit more complicated to warrant a built-in solution to make this setup work. |
Beta Was this translation helpful? Give feedback.
-
This far sits outside the scope of the built in conditions. You would need to make a custom one for this application, sorry. |
Beta Was this translation helpful? Give feedback.
-
During our VR development, we have a Rigidbody based VR character setup like this:
We intentionally avoided putting hand Rigidbody under the body Rigidbody to make Unity behave a little bit more predictably, and avoid spawning three network objects then link them in the client which is a lot more finiky to do.
This setup has been working well until we want to setup position based observer conditions.
I think allowing NetworkObject to set a position transform via inspector and let conditions reference that instead of
nob.transform
could cover this use case.edit: I forgot to mention, in the setup the PlayerPrefab will never move once spawned. It just houses three different rigidbodies that moves on their own.
Beta Was this translation helpful? Give feedback.
All reactions