How do i make animations play in cutscenes

hey guys how do i play animations in cutscene like moving hands fight scenes eg.


heres a video to explain

3 Likes

This is very vague, there are a thousand plus more ways to do this. Just load animations on to humanoid and use remote events to play them.

1 Like

what scripy do i put and do i put the script in the humaonid

script
guys
btw sry for late notice

local Tigry -- Define your character here

local tigryAnimation2 = script:WaitForChild("TigryAnimation2")
local animator = Tigry:FindFirstChildOfClass("Humanoid"):WaitForChild("Animator")

task.wait(2.5)

animator:LoadAnimation(tigryAnimation2)

Still it’s just an example. Feel free to ask any more questions!

Arranging the cutscene animations is all up-to you!
(I play piggy as well)

do i play this in cutscene script or humanoid it looks like humanoid

Make sure it’s played in the cutscene script. You can search up some tutorials on YouTube or DevForum on how to make cutscenes like piggy. You will get it!

ok ccool thanks and btw last question were would i put in the text section were the character speaks or the camera part of the script

You can follow this tutorial right here made by @GnomeCode!

hey were do i play the animation

i also changed my script around the only Problem is idk were to play it local MainCamera = workspace.CurrentCamera
local MyCharacter = game.Players.LocalPlayer.Character
local CameraFolder = game.Workspace.CamFolder

–[[
FUNCTIONS:
]]

function InterpolateCamera(StartCamera, Focus, Duration)–Example: InterpolateCamera(CameraFolder.Cam1, CameraFolder.Cam2, 2)-~-~-~-~First decide your camera, then decide where the camera will look at.
MainCamera.CameraType = Enum.CameraType.Scriptable
MainCamera:Interpolate(StartCamera.CFrame, Focus.CFrame, Duration)
end
local function WriteDialog(object,text)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(0.02)
end
end
function PlayNPCAnimation(Character, AnimationID)–Example: PlayNPCAnimation(game.Workspace.Bob, “rbxassetid://000000”)
for i, v in pairs(Character:GetChildren()) do
if v:IsA(“Humanoid”) then
local Human = v
local AnimationLoaded = v:LoadAnimation(AnimationID)
if Character:FindFirstChild(“HumanoidRootPart”) then
Character.HumanoidRootPart.Anchored = true
else
print(“ERROR: Your character don’t have a HumanoidRootPart! You need to fix it!”)
end
AnimationLoaded:Play()
end
end
end
function SetTalkingCharacter(CharacterName, CharacterColor3fromRGBTextColor)–Example: SetTalkingCharacter(“Bob”, Color3.fromRGB(255, 255, 255))
script.Parent.Parent.CutsceneFrame.CharacterName.Text = CharacterName
script.Parent.Parent.CutsceneFrame.CharacterName.TextColor3 = CharacterColor3fromRGBTextColor
script.Parent.Parent.CutsceneFrame.DialogText.TextColor3 =CharacterColor3fromRGBTextColor
end

function Fade(String_In_Out)–Example: Fade(“In”) [DARK SCREEN] / Fade(“Out”) [FREE SCREEN].
local fadeGui = script.Parent.Parent.FadeFrame
local ts = game:GetService(“TweenService”)
if String_In_Out == “In” then
fadeGui.Visible = true
ts:Create(fadeGui, TweenInfo.new(1), {BackgroundTransparency = 0}):Play()
end
if String_In_Out == “Out” then
fadeGui.Visible = true
ts:Create(fadeGui, TweenInfo.new(1), {BackgroundTransparency = 1}):Play()
end
end

function PlaySound(SoundName, Volume, BoolLoop_True_False)–Example: PlaySound(“Infiltration”, 1, True) [WILL PLAY IN VOLUME 1, AND WILL REPEAT, WARNING: THE THEME HAVE TO BE IN THE “THEMES” FOLDER!!]
local Sound = script.Parent.Parent.Themes:FindFirstChild(SoundName)
Sound.Volume = Volume
if BoolLoop_True_False == true then
Sound.Looped = true
else
Sound.Looped = false
end
Sound:Play()
end
function StopSound(SoundName, StringTweenType)–Example: StopSound(“Infiltration”, “Tweening”)[WILL STOP THE SOUND BY TWEENING] or StopSound(“Infiltration”, “JustStop”)[WILL STOP THE SOUND IMMEDIATELY]
local sound = script.Parent.Parent.Themes:FindFirstChild(SoundName)
if StringTweenType == “Tweening” then
local ts = game:GetService(“TweenService”)
ts:Create(sound, TweenInfo.new(5), {Volume = 0}):Play()
end
if StringTweenType == “JustStop” then
sound:Stop()
end

end
local MyEvent = game.ReplicatedStorage.CutscenesRemotes.PlayFinalCutscene–Set the remote event for the cutscene start.

local ts = game:GetService(“TweenService”)
function PlayCutscene()
script.Parent.Parent.CutsceneFrame.Visible = true

MyCharacter.Head.CFrame = CFrame.new(0,0,0)--Change the position that the character will teleport to!
local dtext = script.Parent.Parent.CutsceneFrame.DialogText
script.Parent.Parent.FadeFrame.BackgroundTransparency = 0
wait(1)
InterpolateCamera(CameraFolder.Cam1, CameraFolder.Cam2, 1)
wait(2)
Fade("Out")
InterpolateCamera(CameraFolder.Cam1, CameraFolder.Cam2, 1)
SetTalkingCharacter("Dontalon", Color3.fromRGB(255, 255, 255))
WriteDialog(dtext, "Oh hello, this is my official piggy pack")
wait(4)
ts:Create(script.Parent.Parent.YouEscapedLabel, TweenInfo.new(1), {TextTransparency = 0}):Play()
InterpolateCamera(CameraFolder.Cam3, CameraFolder.Cam2, 3)
WriteDialog(dtext, "Change the text and make an custom ending")
wait(4)
SetTalkingCharacter("Dontalon", Color3.fromRGB(255, 255, 255))
WriteDialog(dtext, "That was easy?")
wait(4)
ts:Create(script.Parent.Parent.YouEscapedLabel, TweenInfo.new(1), {TextTransparency = 1}):Play()
WriteDialog(dtext, "Here is my models / animations for you")
wait(3)
InterpolateCamera(CameraFolder.Cam1, CameraFolder.Cam2, 2)
SetTalkingCharacter("Dontalon", Color3.fromRGB(255, 255, 255))
WriteDialog(dtext, "Bye")
wait(2)
Fade("In")
script.Parent.Parent.CutsceneFrame.Visible = false

end

MyEvent.OnClientEvent:Connect(PlayCutscene)

Idk were to play the Animation

Humanoid:LoadAnimation() is already deprecated as I already said. You instead need to load the animation inside The Humanoid Instance. So, here’s the updated part of the code:

for i, v in pairs(Character:GetChildren()) do
if v:IsA(“Humanoid”) then
local Animator = v:FindFirstChildOfClass("Animator")
local AnimationLoaded = v:LoadAnimation(AnimationID)
if Character:FindFirstChild(“HumanoidRootPart”) then
Character.HumanoidRootPart.Anchored = true
else
print(“ERROR: Your character don’t have a HumanoidRootPart! You need to fix it!”)
end
AnimationLoaded:Play()
end
end

So I put the script In the humanoid And Add A animation Object and Make it a child and the script the Parent

1 Like

Um dude it didn’t work image

Can you send your script so I can check?

No no, you don’t need to create the Animator inside the humanoid. It gets added by default. (I believe)

i used yours @AridFights1
Then i Put the animation as the child to the script and the animation Id in the animation object

image
So here you see, you have a script inside the Humanoid. It should be a LocalScript. And yes the Animation should be inside the LocalScript. And then you added another Animation or AnimationController I believe. And I do believe that you can’t insert the Animator in a normal way. What you need to do is turn on Command Bar and type Instance.new("Animator", locationOfTheHumanoid). Then it should insert the Animator inside the Humanoid, then just delete the Animation which you named Animator.

Edit 1: if you don’t know how to turn on Command Bar, then go to View → Command Bar
Edit 2: If you have discord add me at AridTheDev#0596