Moon Animation Suite gives you the ability to incorporate camera movement into your animations (Example shown below) however it doesn’t tell you how to use this in-game. How would I go about doing this?
https://i.gyazo.com/aa3eeb0d9e97703bcc53bbe186e50c0a.mp4
I was having the exact same issue and been searching everywhere to figure out what to do. After a while I just said screw it and figure it out on my own.
Basically, there’s a folder for your camera movement when you export it from moon studio. This folder contains CFrameValues. CFrameValues can’t actually be edited and can only be accessed through the script. Basically, the names of the CFramevalue are related to the frame its own. What this means is that for you to see the full animation, you need to play each frame of the camera position within a certain amount of time tuned to the framerate you want.
I have created a script that get the frames from Moon Sutdio export folder and applies the positions to a camera based on a recorded frame.
-- Something to note is that wait() minimum waiting time is 0.0333 meaning if you recorded the camera originally in 60 frames per second and try to wait for 1 out of 60 frames per second(0.016) it will automatically go to 0.03
-- Basically the highest rate you can go is 30 frames per second unless you use something like RunService.Heartbeat:Wait() that waits based on the current system's framerate but I wouldn't recommend it if you have animations you want sync to the camera movement
--The speed of each camera frame moves
-- Its set to 60 frames per second
local fps = 1/60
-- This grabs the camera folder that contain the frames and get all children
local fold = game:GetService("ServerStorage"):WaitForChild("MoonAnimatorExport"):WaitForChild("Camera Testing_Camera"):WaitForChild("Frames"):GetChildren()
-- This is how many frames are in this camera movement
local frames = #fold
--Replace this with the camera you want to move
local cam
-- This will run for each frame
for i=1,frames do
--This grabs the CFrame value from the folder base on what frame we're on
local cf = fold[i]
-- Check if the object exists
if cf then
--Set the CFrame to the current frame CFrame
cam.CFrame = cf.Value
--Wait the fraction of the frames per second(this is the seconds you wait for one 1 out of 60 which is 0.016)
wait(fps)
end
end
wouldn’t that go directly towards where the animation was made in studio?
I hope this can help u
Use events like bindable or remote