Animation Track Property Signal


local player = game.Players.LocalPlayer
local char= player.Character or player.CharacterAdded:Wait()
local Humanoid = char.Humanoid or char:WaitForChild("Humanoid")
local Animator: Animator = Humanoid.Animator
local Anim = game.ReplicatedStorage.Anims.TestAnim
local Atrack = Animator:LoadAnimation(Anim)


task.wait(1)
Atrack:Play()

local Signal = Atrack:GetPropertyChangedSignal("TimePosition"):Connect(function(...: any) 
	print("Changing TimePos: \n", ...)	
end)
print("playing, ; ", Atrack.TimePosition)

task.wait(0.1)
print(Atrack.TimePosition, Signal)

Steps:
create an anim and publish and change the AnimationId of the TestAnim

the Problem:
the GetPropertyChangedSignal does not work for AnimationTrack

Expected behavior

the GetPropertyChangedSignal should be constantly firing for TimePosition Property after playing the Anim

4 Likes

Thanks for your feedback!
In fact, TimePosition is a bit of a “unicorn” property in that setting it behaves more like firing an Event.
Setting TimePosition will cause the track to jump to the specified point in the animation, but the Property is not actually updated when the track progresses normally. (That would be a performance concern, especially since TimePosition is replicated in the OnCombinedUpdate Event.)
Rather than listening to GetPropertyChangedSignal you could just respond to RunServer:Stepped or any other per-frame signal.

7 Likes

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