Currently working on coding some animations for my up and coming game.
I’ve followed everything known to my knownlage but cannot seem to find a reason to my error.
I’ve put a LocalScript into StarterCharacterScripts
Animation IDs were added into the “Animation” under the LocalScript
--------------------------------------------------------------
-- || Client-Sided LocalScript created by: @Joeys2Valid
-- || Created on September 27, 2024 at 11:41 PM (23:41)
--------------------------------------------------------------
-- // MAIN SCRIPT
--------------------------------------------------------------
local animation = script:WaitForChild("Animation")
local humanoid = script.Parent:WaitForChild("Humanoid")
local AnimationTrack = humanoid:LoadAnimation(animation)
AnimationTrack:Play()
--[[
--------------------------------------------------------------
N O T E S
--------------------------------------------------------------
]]
Thank you for your time for reading this/and trying to help in advance.
And what is your error? Also it’s better if you load the animation on the Animator instance inside the players humanoid
local animation = script:WaitForChild("Animation")
local player = player.Character or player.CharacterAdded:Wait()
local humanoid = player.Character:WaitForChild("Humanoid")
local Animator = humanoid:FindFirstChildWhichIsA("Animator") or Instance.new("Animator").Parent = humanoid
local AnimationTrack = Animator:LoadAnimation(animation)
AnimationTrack:Play()
local animation = script:WaitForChild("Animation")
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:FindFirstChildWhichIsA("Animator") or Instance.new("Animator").Parent = humanoid
local AnimationTrack = Animator:LoadAnimation(animation)
AnimationTrack:Play()
My bad i just realised the script has an error, i haven’t tested it until now, this seems to be working fine for me.
local animation = script:WaitForChild("Animation")
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:FindFirstChildWhichIsA("Animator") or Instance.new("Animator", humanoid)
task.wait(5)
local AnimationTrack = Animator:LoadAnimation(animation)
AnimationTrack:Play()
local animation = script:WaitForChild("Animation")
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:FindFirstChildWhichIsA("Animator") or Instance.new("Animator", humanoid)
task.wait(5)
for _,v in script:GetChildren() do
if not v:IsA("Animation") then return end
local AnimationTrack = Animator:LoadAnimation(animation)
AnimationTrack:Play()
AnimationTrack.Ended:Wait()
end
My bad again, i might have to start testing my scripts before replying
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:FindFirstChildWhichIsA("Animator") or Instance.new("Animator", humanoid)
task.wait(5)
for _,v in script:GetChildren() do
if not v:IsA("Animation") then return end
local AnimationTrack = Animator:LoadAnimation(v)
AnimationTrack:Play()
AnimationTrack.Ended:Wait()
end