Load animation is only working the second time it is ran. All other code works fine. And the animation says it is playing. The animation is on a rigged part. Here is code:
local function Animation(Chest, state)
local OpenAnim = Chest.Animations:WaitForChild("Open")
local controller = Chest.AnimationController
local prompt = Chest.Extra.Union.ProximityPrompt
local Open = controller:LoadAnimation(OpenAnim)
if state == "start" then
print(state) -- prints start
prompt.Enabled = false
Open:Play()
task.delay(Open.Length-.01, function()
Open:AdjustSpeed(0)
end)
-- ignore this:
local open = game.ReplicatedStorage.Sounds.ChestOpenSound:Clone()
open.Parent = Chest.UI
open:Play()
if not open.Playing then
open:Destroy()
open = nil
end
else
prompt.Enabled = true
local close = game.ReplicatedStorage.Sounds.ChestCloseSound:Clone()
close.Parent = Chest.UI
close:Play()
Open:AdjustSpeed(1)
if not close.Playing then
close:Destroy()
close = nil
end
end
end
Hi! Here is a post explaining the animator: Animator | Documentation - Roblox Creator Hub. Essentially, the animator is a class inside the humanoid responsible for playing and replicating animations.
i unfortunetly cant cuz this pc is so garbage. but i have the animation controller and animation both in a folder, and under the controller is the animator