Get animation keyfram

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I would like to be able to move the dummy if the animation has reached a certain keyframe of it.

  2. What is the issue? Include screenshots / videos if possible!
    Idk where to start on scripting it.
    My animation script:

--Services
local RS = game:GetService("ReplicatedStorage")

--Variables
local Spawner = script.Parent.ProximityPrompt
local Child = RS.Models.Ant

--Function
local function Click()
	--Child Cloner
	local Clone = Child:Clone()
	Clone.Parent = game.Workspace
	local Animation = Clone.Humanoid:LoadAnimation(Child.Animations.Spawn)
	
	Animation:Play()
    --Here i would like to get at which frame the animation has arrived.
    --If it's at a specific one, like 10, then move the dummy to a different position.
	Animation.Stopped:Wait()
	Animation:Destroy()
end
--Function starter
Spawner.Triggered:Connect(Click)
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Tried searching around, found nothing.

You can use the rbxsignal GetMarkerReachedSignal from the animation track for this.
Here’s more info:
https://create.roblox.com/docs/reference/engine/classes/AnimationTrack#GetMarkerReachedSignal

1 Like

THANK YOU A LOT!!! i’ll read it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.