How to make a Model Tween within a Car Body

Ive been trying to get this ramp to tween outwards whenever a user would trigger it by pressing a key.

But whenever it does start to tween, the whole vehicle would go crazy, and my guess is that it is trying to change the CFrame of the whole car model since they are welded.

Is there a way to fix this, or a way around this?
Note: I am using A-Chassis as my Chassis Model.

Heres my scripts:

"Keys" (Server-Sided Script)
-- Define Variables
local RAMPO = script.Parent.Values.RampO
local RAMPD = script.Parent.Values.RampD
local RAMPU = script.Parent.Values.RampU
local RAMPI = script.Parent.Values.RampI
local RAMPB = script.Parent.Values.RampB

local RAMPF = script.Parent.Values.RampF

----
local TweenService = game:GetService("TweenService")

local mainLift = script.Parent.Lift.Base.MainBase
local Out = script.Parent.Lift.End
local In = script.Parent.Lift.Back
local topIn = script.Parent.Lift.TopEnd
local topOut = script.Parent.Lift.TopStart
local groundEnd = script.Parent.Lift.GroundEnd

local goal = {}
goal.Position = Vector3.new(-104.23, 2.932, -8.873)

local tweenInfo = TweenInfo.new(
	6,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false
)

local baseOut = TweenService:Create(mainLift, tweenInfo, {CFrame = CFrame.new(Out.Position)})
local baseDown = TweenService:Create(mainLift, tweenInfo, {CFrame = CFrame.new(groundEnd.Position)})
local baseUpperOut = TweenService:Create(mainLift, tweenInfo, {CFrame = CFrame.new(topOut.Position)})
local baseUpperIn = TweenService:Create(mainLift, tweenInfo, {CFrame = CFrame.new(topIn.Position)})
local baseIn = TweenService:Create(mainLift, tweenInfo, {CFrame = CFrame.new(In.Position)})

-- // Ramp Handling

function rampFold()
	local M1 = script.Parent.Lift.Base.Motor1.Motor
	local M2 = script.Parent.Lift.Base.Motor2.Motor

	if RAMPF.Value == false then
		M1.MaxVelocity = 0.050 -- original value: 0.075
		M2.MaxVelocity = 0.050 -- original value: 0.075
		M1.DesiredAngle = -3.15
		M2.DesiredAngle = 3.15
	elseif RAMPF.Value == true then
		M1.MaxVelocity = 0.050 -- original value: 0.075
		M2.MaxVelocity = 0.050 -- original value: 0.075
		M1.DesiredAngle = 0
		M2.DesiredAngle = 0
	end
end
RAMPF.Changed:connect(rampFold)

function rampOut()
	--baseOut:Play()
	changeExtension(Out.Position.X)
	warn("Should Have Tweened")
end
RAMPO.Changed:connect(rampOut)

function rampDown()
	baseDown:Play()
	warn("Should Have Tweened")
end
RAMPD.Changed:connect(rampDown)

function rampUp()
	baseUpperOut:Play()
	warn("Should Have Tweened")
end
RAMPU.Changed:connect(rampUp)

function rampIn()
	baseUpperIn:Play()
	warn("Should Have Tweened")
end
RAMPI.Changed:connect(rampIn)

function rampBack()
	baseIn:Play()
	warn("Should Have Tweened")
end
RAMPB.Changed:connect(rampBack)
"LocalScript" (located in a DriverSeat)
-- // RAMP CONTROL 

mouse.KeyDown:connect(function(key)
	if key=="6" then 
		veh.Values.RampOut:FireServer(true)
	end
end)

mouse.KeyDown:connect(function(key)
	if key=="3" then 
		veh.Values.RampDown:FireServer(true)
	end
end)

mouse.KeyDown:connect(function(key)
	if key=="9" then 
		veh.Values.RampUp:FireServer(true)
	end
end)

mouse.KeyDown:connect(function(key)
	if key=="8" then 
		veh.Values.RampIn:FireServer(true)
	end
end)

mouse.KeyDown:connect(function(key)
	if key=="5" then 
		veh.Values.RampBack:FireServer(true)
	end
end)

mouse.KeyDown:connect(function(key)
	if key=="2" then 
		veh.Values.RampFold:FireServer(true)
	end
end)

Thanks in advance.

1 Like