How to tween MaxVelocity on a Motor6D?

Hey, I want to tween MaxVelocity on my Motor6D for a slow slowdown.

function Helicopter.stopPropeller(stopTime)
	local HeliObject = CS:GetTagged("Helicopter")

	for _, heli in HeliObject do
		local object = heli:GetDescendants()

		for _, objectPart in object do
			if objectPart:IsA("Motor6D") then
                --local goal = {}
                --goal.MaxVelocity = 0
                --local tweenInfo = TweenInfo.new(stopTime)

                --local tween = TS:Create(objectPart.MaxVelocity, tweenInfo, goal)

                --tween:Play()

				----objectPart.MaxVelocity = 0
			end
		end
	end
end

I found out from an old devforum post How do you tween a Motor6D.C0 with TweenService?

and I just modified it to my own use

local function TweenVel(Motor, EndV, time)
	local prop = { MaxVelocity = EndV }
	local info = TweenInfo.new(time, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
	return TS:Create(Motor, info, prop)
end

-- and to play the tween:

tween = TweenVel(script.Parent, 0, 5)
tween:Play()
1 Like

how come i keep finding solution after i make a post :expressionless:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.