Hello everyone,
I’m struggling with a classic timing issue and would appreciate some advice on the standard, robust solution.
The Goal: I have an animation of a chest falling from the sky. When it lands, I want it to freeze permanently in its final pose.
The Problem: To achieve this, I placed an Event Marker named "EndPose" on the second-to-last frame of the animation. My script listens for this marker and sets the animation speed to 0.
However, this method is unreliable and only works about 50% of the time, as you can see in the video.
- When it works: The animation freezes perfectly, and the chest stays on the ground.
- When it fails: The animation plays, but instead of freezing, the entire model instantly snaps back to its original starting pose.
This feels like a classic race condition, where the animation sometimes ends before my script can react to the marker. I have already confirmed my model’s HumanoidRootPart is Anchored.
Here is my full script:
task.wait(2)
local character = script.Parent
local humanoid = character:WaitForChild('Humanoid')
local animator = humanoid:WaitForChild("Animator")
local chest = character:WaitForChild("Chest")
local particle = script.Parent.Parent:WaitForChild("Smoke Particle"):WaitForChild("Smoke Particle")
local animation = script:WaitForChild('Animation')
-- Sounds
local landingSound = particle.Parent:WaitForChild("Heavy Landing")
local fallingSound = particle.Parent:WaitForChild("Falling")
local chestSound = chest:WaitForChild("ChestSound")
local animationTrack = animator:LoadAnimation(animation)
-- This marker is for mid-animation effects
animationTrack:GetMarkerReachedSignal("TouchedGround"):Connect(function()
fallingSound:Stop()
landingSound:Play()
particle.Enabled = true
task.wait(0.2)
particle.Enabled = false
end)
--[[
-- THE UNRELIABLE PART OF THE SCRIPT --
This is my attempt to freeze the animation. It seems to be in a "race"
with the animation ending naturally, and it often loses.
--]]
animationTrack:GetMarkerReachedSignal("EndPose"):Connect(function()
print("EndPose Triggered, attempting to freeze animation...")
animationTrack:AdjustSpeed(0)
end)
-- Start the sequence
animationTrack:Play()
fallingSound:Play()
chestSound:Play()`
My Question:
How can I modify my approach to guarantee that the animation always freezes in its final pose? What is the method to solve this kind of timing-sensitive problem and make the result 100% reliable?
Thank you for your help!

