My swining door is stiff and unresponsive

I made a double door wit hinge constrains and then used springs to make the door bounce back into place, followed a tutorial to each exact placement. The doors open sure, but I run into them and there is a clear noticeable delay. If I stand there and mess around with the doors for a minute or more then suddenly they become completely responsive, which is strange. The springs hardly do their job as the door is never back to its original position, just sort of close to it.

1 Like

I am pretty certain this (atleast the delay part you’re talking about) is because of network ownership, I’ve found it to be acting weird in studio when playtesting too, in the actual game the client gains ownership of assemblies near it faster and more reliably than in studio it seems (if I am not crazy). If this is an issue for you and your game is singleplayer only you could just give the player the network ownership of the door instead of letting the server decide automatically. But I think this is a bug?

This is indeed because of networkownership.

But, there is a really good fix that still makes the door work as expected.

In a place like ReplicatedFirst, make a LocalScript.

local door = workspace:WaitForChild("Door")
door:Clone().Parent = door.Parent
door:Destroy()

-- or just make a client-context script and place it in door.

This is not a roblox bug but rather just how physics in Roblox work.
If you edit the door on the server you can either

A. Fire remote events, this is recommended if your game is multiplayer
B. Disregard the script if singleplayer and instead make a script on the server to set the networkOwnerShip of the door to the single player

It is multiplayer though, I dont know how to make a client context script in the door either

Do you ever do any specific effects on the server like locking the door? Or is it just a prop that stays the same?

at this point its just a prop that stays the same

Ok, here are steps to fix the door since I learn it’s not really being interacted by the server.

  1. Insert a normal script inside the door
    image

  2. In the properties of the script, change the RunContext property to Client

  3. In the script, paste this code:

local Door = script.Parent
Door:Clone().Parent = Door.Parent
Door:Destroy()

Now you should test it and see if it’s fully responsive now. Optionally if you’re a more experienced programmer you can add tags to doors and manage them all from one client script.

I tried this method and every time my door completely disappears from view. It seems to be in the workspace when I click play but the children of the models are gone, so the parts disappear and the attachments are gone

image

disable StreamingEnabled in workspace, and it should fix this.

Sometimes I wonder how people like yourself gain the knowledge to answer these questions and fix the problem. Anyway, thank you very much, it works now.

1 Like