Trying to play moonanimator camera in-game is very snappy

I am trying to play moon animator camera animations in game, but it doesnt work as intended and just snaps my camera. Here’s the code I’m using.

local fps = 1/60
local fold = game:GetService("ReplicatedStorage"):WaitForChild("Rush_Camera"):WaitForChild("Frames"):GetChildren()
local frames = #fold
local cam = workspace.CurrentCamera

for i=1,frames do
	local cf = fold[i]
	if cf then
		cam.CFrame = cf.Value
		wait(fps)
	end
end

if you don’t want it to snap, I recommend tweenservice for this. (also, wait can’t go below 0.3)

How would I tween it to the cframe value correctly each time?

When I mean this, I mean make the animation relative to the player. This is the animation I am using for the camera.
https://gyazo.com/fe8e6860487e67429fe09682eefacd85

https://gyazo.com/be3ea1da71d8b225127d97bbf94cc165 Heres an example of what is happening.

you will have to update the camera every frame with renderstepped rather than doing wait()

1 Like

Can I get an example on how I would do this with this code?

just replacing the wait should work, however its better if you wrap the whole code in the renderstepped function

local runservice = game:GetService("RunService")

for i=1,frames do
	local cf = fold[i]
	if cf then
		cam.CFrame = cf.Value
		runservice.RenderStepped:Wait()
	end
end

or alternatively, you can animate the camera with my rig which makes the implementation of imported camera animations much easier :wink:

1 Like

Can I see what it can do? Also, I’ll try that out

oh weird, the embedded link on that text broke, heres the link Camera Manipulation Rig + Effects Module

1 Like

i see, i already have the camera animation done, can I just import the rig into it and it would work? the code still doesn’t work by the way

Here’s what happens to the camera
https://gyazo.com/ac1d8790cc339fa7593ef2566d683839
I want it to be relative to the player

you would need to remake the camera animation on the rig, to make the rig move relative to the player just clone a new rig whenever a players character is loaded and weld the root parts together
oh yeah make sure the rigs cframe is the same as the humanoidrootpart while animating so you know its 100% going to work

I see, is this the only way I can do this camera animation?

pretty much, even if you got the last animation working properly, the cframe wouldnt be relative to the player

1 Like

Would I weld the cam part to the player, then put a motor6d and then just put it in the rig and then animate it for camera effects relative to the player.?