Hi!
I’m trying to get the Animation ID that is playing inside of the player. I’ve tried using GetPlayingAnimationTracks(), but it doesn’t seem to do what I want.
Does anyone know how to do this?
Hi!
I’m trying to get the Animation ID that is playing inside of the player. I’ve tried using GetPlayingAnimationTracks(), but it doesn’t seem to do what I want.
Does anyone know how to do this?
GetPlayingAnimationTracks should work, are you possibly using the humanoid instead of the animator? For the specific ID, you could probably check for it in the index of the returned array.
Get all the playing AnimationTracks
, iterate through them, check if they have an underlying Animation
attached, and if they do insert their id.
local function GetPlayingAnimationIds(Animator: Animator): {string}
local PlayingTracks = Animator:GetPlayingAnimationTracks() :: {AnimationTrack}
local PlayingAnimationIds = {}
for Index, Track in PlayingTracks do
local Animation = Track.Animation
if Animation then
table.insert(PlayingAnimationIds, Animation.AnimationId)
end
end
return PlayingAnimationIds
end