Host sinking through the ground
Hello, im having some issues, where the host sinks through the ground and can't move when the second player joins. Could this be an issue with Rigidbody and the transform?
12 Replies
Hi @MrCaptain22. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, it could be an issue with Rigidbody and the transform. In Unity, the Rigidbody component is used for objects that are intended to move and be affected by physics. If the host is sinking through the ground, it could be due to incorrect Rigidbody settings or issues with the Transform component.
In NormalVR, when operating in Rigidbody mode, RealtimeTransform synchronizes the world position and rotation values in addition to all Rigidbody settings. This is because Unity's physics engine (PhysX) works entirely in world space. For this reason, Unity recommends you do not add parents to Rigidbody components; Normcore recommends the same. This way, you can avoid the transform hierarchy issues mentioned above. source (https://normcore.io/documentation/realtime/realtimetransform#rigidbody-mode)
Also, if you have a Rigidbody with a child that also has a Rigidbody component, you're going to end up with unpredictable results. The core issue is that when Unity synchronizes the Rigidbody
position
and rotation
of each object back to the Transform component, if it synchronizes the child before the parent, the child will end up at the wrong location. To summarize, rigidbodies cannot have parent game objects unless the parent never moves. source (https://normcore.io/documentation/realtime/networked-physics#realtimetransform--rigidbody-should-not-have-parents)
If the host can't move, it could be due to the RealtimeTransform component not having an owner. RealtimeTransform requires an owner in order to designate which client is responsible for its movement. You can try calling RequestOwnership()
. source (https://normcore.io/documentation/realtime/common-questions#my-realtimetransform-gets-stuck-and-i-cant-move-it-what-can-i-do-about-this)
If you're still encountering issues after checking these points, I recommend reaching out to the Normcore community on their Discord (https://normcore.io/documentation/essentials/common-questions#does-normcore-support-x-y-z) for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@240257613319634944> kapa.ai is still learning and improving, please let us know how it did by reacting below
@Normcore Assistant here is my Realtime Transform settings and i did change the Sleep option to Maintain ownership while sleeping
Let me check the knowledge base for you. One moment! :books:
----------------------
I'm sorry, but as an AI, I'm unable to directly view or analyze images or files you might be referring to. However, I can still provide some guidance on what to check in your RealtimeTransform settings.
1. Sync Settings: Make sure the sync settings (syncTransform, syncPosition, syncRotation, syncScale) are set correctly. If these are set to true, the transform will sync its position, rotation, and scale with the model. source (https://normcore.io/documentation/reference/classes/Normal.Realtime.RealtimeTransform)
2. Ownership: Check if the RealtimeTransform component is owned by the correct client. In order to move an object with a RealtimeTransform component, your client needs to be the owner of the RealtimeTransform component. You can request ownership of a RealtimeTransform component by calling
RequestOwnership()
. source (https://normcore.io/documentation/realtime/realtimetransform#how-it-works)
3. Sleep Option: If you've set the sleep option to "Maintain Ownership While Sleeping", the RealtimeTransform will continue to be owned by the local client when the attached rigidbody goes to sleep. This will prevent other clients from taking over the simulation for this object. source (https://normcore.io/documentation/realtime/realtimetransform#rigidbody-mode)
4. Rigidbody Settings: If you're using Rigidbody mode, ensure that the Rigidbody settings are correctly configured. RealtimeTransform synchronizes the world position and rotation values in addition to all Rigidbody settings. source (https://normcore.io/documentation/realtime/realtimetransform#rigidbody-mode)
If you've checked all these settings and are still experiencing issues, it might be helpful to reach out to the Normcore community or support for more specific assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@240257613319634944> kapa.ai is still learning and improving, please let us know how it did by reacting below
probably because your player controller is running on the remote client
check ownership of the view and disabling it for non-owners
Thanks, i'll check it out in a min and i'll get back to you.
Sadly, did not work.
and when i try to look left or right, its almost like its stuck, but i can look up and down while being stuck in the same position, or i sinks to the ground.
post your code
Mind you, im still learning so dont be too harsh 😅
i probably have overlooked something and messed it up badly
So i just did some testing, and it seems like when i move with the client, it also moves the camera in unity at the same time.
i'm gonna scrap it and try again from scratch, i'll figure it out at some point.
start with the hover bird example
Yeah, i'll look into it, i was taking a look into the documentations now
and decided to start from scratch again
but thanks for answering anyways