I have a
RemoteEvent that fires from server code, which changes the
TargetAngle of a
HingeConstraint for one player. It’s triggered by the player colliding with a
HingeConstraint controls a door that I want to open before the
The event fires and is received correctly, and
TargetAngle is updated. The door behaves very oddly though.
Sometimes it opens. Sometimes is waits a little while. Sometimes it opens and closes at random. It feels as though there’s some conflict between the server value and the local value of
How do I resolve this?
if humanoid then local player = getPlayerFromCharacter(partParent) setVariableEvent:FireClient(player, hitbox.Door.HingeConstraint, "TargetAngle", -90) end
local ReplicatedStorage = game:GetService("ReplicatedStorage") local setVariableEvent = ReplicatedStorage.RemoteEvents.OneClient:WaitForChild("SetVariable") local function onSetVariable(object, attribute, value) object[attribute] = value end setVariableEvent.OnClientEvent:Connect(onSetVariable)