Trunk of transporter not opening

Hi everyone,
I recently began working on my transporter and one of its core feature is the openable trunk for mailman, officers,… to work.

The problem I face is that the trunk doesnt open.

local Hinge = script.Parent.Pivot
local opened = false

function Open()
	if opened == false then
		opened = true
		for i = 1, 18 do
			script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(5), 0))
			wait()
		end
	else
		opened = false
		for i = 1, 18 do
			script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(-5), 0))
		end
	end
end

script.Parent.paint5.ClickDetector.MouseClick:Connect(Open)
  • No logs in console
  • Tried already with TweenService, also didnt work
  • Watched various YouTube tutorials, didn’t work either
  • Copied the car into a brand new baseplate, nothing changed
  • Printed :SetPrimaryPartCFrame (all I get is nil, nothing else, is that normal?)

For your info: I checked the script many times, everything is correct. I checked the Roblox Docs too to see if I did a mistake but it should work according to the docs.
Everything of the script works. It just doesnt do the stuff its meant to do at the :SetPrimaryPartCFrame line.

Thanks in advance for any help.

If it’s a vehicle I would check all connections such as welds, settings the cframe with weld constraints would move the entire vehicle, but that might be negated by the physics inside the car

This would be math.deg(5), he’s turning 5 degrees into radians

math.rad(5) → 0.087266462599716

Hi,
its an A-Chassis vehicle, could this be the issue?
Also, math.deg(5) didn’t work either, no errors in log :confused:

€dit: I found out due to the A-Chassis welding system that this won’t work so I have to work out the other variant of adding the opened trunk and making it simply invisible.

1 Like

A way I figured out how to do this with welds is to change the .Orientation property, if you’re door has more parts however it gets very complicated.