Anchoring issue

Basically, the trailer gets anchored BEFORE moving the legs, causing this (video^)

Here’s the part of the script that handles the moving and anchoring

local legs = trailer.Misc:FindFirstChild('LegPart', true)
if legs then
	legs.Anchored = true
	local lre = Instance.new('RemoteEvent')
	lre.Name = 'TrailerLegsEvent'
	lre.Parent = trailer
	local lowered = true
	lre.OnServerEvent:Connect(function(plr, bool)
		if not bool then
			legs.PrismaticConstraint.TargetPosition = 0
			lowered = false
			legs.Raise:Play()
			task.wait()
			print("legs are up")
			legs.Anchored = false
			warn("unanchored")
		else
			legs.PrismaticConstraint.TargetPosition = 1.6
			lowered = true
			legs.Lower:Play()
			while lowered == true and legs.PrismaticConstraint.CurrentPosition > 0 do task.wait() end
			if lowered == true then
				print("legs are down")
				legs.Anchored = true
				warn("anchored")
			end
		end
	end)
end

Didn’t help, doesn’t anchor at all now

that for some reason literally freezes the game

You can’t anchor the legs like that an except the vehicle to move up while the legs are moving down basically pushing it up. You need to learn about Kinematics.

It works fine on the template though, this is a custom model for a trailer system