SetPrimaryPartCFrame not working as intended

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A door, where when you interact with a proximityprompt it will go from opened to closed, or closed to open.

  2. What is the issue? Include screenshots / videos if possible!
    The thing will just rotate by 90 degrees when I interact.

Video of the buggy door:

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

None

Script:

prompt.Triggered:Connect(function()
	if object.PrimaryPart.CFrame == object.DoorHingeClosed then
		object:SetPrimaryPartCFrame(object.DoorHingeOpened.CFrame)
	else
		object:SetPrimaryPartCFrame(object.DoorHingeClosed.CFrame)
	end
end)

DoorHingeOpened and DoorHingeClosed are within the model? If so, take all the door pieces and put them in another model inside the door and set that one.

1 Like

looks to me like the “object” is inside the model, if it is it will take the objects Cframe and change it bc its inside the model

1 Like

Oh, the doorhinge parts are inside the model. I forgot that SetPrimaryPartCFrame would do that, lol.

1 Like