CFrame lerp support (mask function)

--animation code:

local run = {}

run.time = tick()
run.dt = 1/60
run.framerate = 1 / run.dt

runservice.RenderStepped:connect(function()
	local newtime = tick()
	run.dt = newtime - run.time
	run.time = newtime
	run.framerate = 1 / run.dt
	
		
	
end)

does this make sense?

Yeah but I’m just gonna try to make it work

*Copy the code I have right above

*Replace RenderStepped with Heartbeat

*Resend the entire code so I can see it again

Send me a copy of the animation code as well

local c0 = Weld.C0
	local alpha = 0
	local duration = 0.5
	while true do
		renderstepped:wait()
		if alpha >= 1 then break end
		alpha = math.min(1, alpha + (1 / (run.framerate * duration)))
		local target = CFRAME GOAL
Weld.C0 = c0:Lerp(target, (math.min(1, alpha + (1 / run.framerate * duration))))
	end

Your animation logic doesn’t follow this format…

It’s literally a simple fix… Just copy and paste the code, and replace the name “Weld” with your weld variable…

And replace “target” with your CFrame Goal…

Legit what I did, but let me change everything to your standards and I’ll bet it won’t work.
Tell me what’s different
Ok I just changed “Hearbeat” to “Heartbeat”

does it work?

Yeah, surprisingly it does work.
Although it doesn’t have that response feedback when it’s arriving the goal,
it slows down like the tweenservice one.

Well it’s meant to be linear…

You could duplicate the code, and have two separate animations… (rotate the helmet half way, and then the second animation can have a longer duration)

Yeah so after all of that effort, I now have to use tween service because of the EasingStyle - Quart, it has that nice response and it’s not so much effort.
Nice time talking to you and I’m thankful for your effort. Also thanks to LMH_Hutch

I would save that code (that I made) for future things… I use that same type of animation logic for a lot of my player animations for my own game that I am developing.

Alright sure, I definitely will, thanks for all of your help so far.

Yeah, no problem.

2 Likes