i want the animation to play with my character but instead it plays with the rig, also the camera animation is fixed
i want the animation to play with my character but instead it plays with the rig, also the camera animation is fixed
When editing the animation, you want to press “Camera” then “Reference” to then set the reference to the rigs Humanoid Root Part. This will make it so the camera follows the players rig and the cutscenes play as normal ![]()
okay thank you also another thing, how do i play the animation in game?
To play the animation, it comes in two separate parts when exporting it. The animation itself and a folder that is produced under the name of your animation (Either place the folder in Workspace or RS) . This folder contains another folder called “Frames” which are the individual cframes of the camera which will need to be played alongside your animation.
On the client, to play the animation itself, you just do:
local animator : Animator = Character.Humanoid:WaitForChild("Animator")
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://REPLACE_WITH_YOUR_ID_HERE"
local Animation = animator:LoadAnimation(Anim)
Animation:Play()
To play your camera cframes, you would make a connection to RunService.RenderStepped
Here is the example code:
local RunService = game:GetService("RunService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Camera = workspace.Camera
local CinematicsFolder = PATH_TO_YOUR_FOLDER
local CurrentCameraCFrame = workspace.CurrentCamera.CFrame
local FrameTime = 0
local Connection
Character.Humanoid.AutoRotate = false
Camera.CameraType = Enum.CameraType.Scriptable
Connection = RunService.RenderStepped:Connect(function(DeltaTime:number)
FrameTime += (DeltaTime * 60)
-- Delta time is the time elapsed since the previous frame
-- then it converts DeltaTime to the frame of the camera
-- And it then adds this to the total elapsed time since the animation began.
local NeededFrame = CinematicsFolder.Frames:FindFirstChild(tonumber(math.ceil(FrameTime)))
if NeededFrame then
Camera.CFrame = Character.HumanoidRootPart.CFrame * NeededFrame.Value
else
Connection:Disconnect()
Character.Humanoid.AutoRotate = true
Camera.CameraType = Enum.CameraType.Custom
Camera.CFrame = CurrentCameraCFrame
end
end)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

