Hinge door is "laggy"

Heyy! I was trying to make a swinging door and ended with this here: https://gyazo.com/8e32a9206ea5dcae757e2a033701fc47

It feels so stiff and “laggy” while yet having the density on all parts on 0.1, having set collission groups (frame does not collide with door), got a hinge constraint and spring constraints. Any idea’s how to fix this?

Not sure, but could this be a network ownership issue?

1 Like

Could you elaborate please? Like wdym network ownership

Roblox uses a distributed physics system, meaning physics simulation is handled on the server and clients. Although I am not 100% sure, the network ownership of the door model could be the server, making it laggy. You could try checking the network ownership status in-game, and set the ownership manually if necessary.

I assumed the network ownership to be assigned to you at that distance, but maybe it does not happen all the time. Again, not sure. You could try checking out the documentation or the tutorial listed below.

1 Like

This is most likely a network ownership issue, which is normal in this context.

When beginning a session, network ownership only takes up a small radius, making it hard for your character to control any unanchored objects in the workspace. As time passes though, your “control radius” eventually grows and you are able to more easily interact with unanchored objects.

Just wait a little longer before using the door, and you will see it become smoother and more responsive

2 Likes

Well, I want the door to open smoothly for everyone. Can’t I set the OwnerNetworkShip only to one person at a time?

Roblox automatically figures out a way to handle network ownership between multiple people, meaning it will try and make it smooth for as many people it possibly can. While you can manually set a network owner, I would do some multiplayer testing to see if you are fine with how Roblox already does their assigning.

Well I believe this is how it is right now which is sadly pretty laggy.

Well, there’s two options you could do:

  • 1st is to make an interaction system with the door and animate the door opening or closing depending on its state.
  • 2nd option is to make whoever touches the door the network owner of the door temporarily.

I should note that with the second option, it may still appear laggy to other users since physics and networking don’t really work together at times.

you could make it so when the client joins it actually clones the door and deletes the previous one. Now everybody has a version of the door that will work smoothly.

Yea but I’d like to have it synced like in the Doors lobby: https://gyazo.com/c689d7ddf3a4f365b98bfaecb3e0f25a . If possible I’d like to recreate this door 100% (ofc not the model) but I have no clue how else I should do it.

Yes, that’s what’s going to happen. This is because other players are also physical objects with forces that replicate for your client too. I can confirm as I have used these methods before.

Also does look like doors is using a client method too for it to be that smooth.

I used to use an old method which was just setting the network ownership of the door automatically that could easily cause unintended behavior still. Now I realize I can just make a client version and it behaves the same using less server resources and being smoother overall.

Well, if the doors are being handled each locally, the door wont open for player1 if player2 opens it as it’s local.

if you’re using purely physics for these doors then the physics are indeed going to replicate. That is how doors is doing it and that’s the only way (or create a physics engine from scratch in roblox,) ER:LC also uses this method.

I didn’t think physics would replicated for humanoids but they do and when I think about it it does make sense now.

Try cloning the door for every client.

LocalScript in game.StarterPlayer.StarterPlayerScripts

local Door = workspace.Door
local ClientDoor = Door:Clone()

Door:Destroy()
ClientDoor.Parent = workspace
1 Like