Check if animation is R6 or R15 from a script

How can I check whether an animation is R6 or R15 from a script?
Thanks in advance!

1 Like

This might not be for animation but closest thing:

if humanoid.RigType == Enum.HumanoidRigType.R6 then
	-- R6
else
	-- R15
end
2 Likes

Basically, I’m trying to have find whether an animation is R6 or R15 so I can get the proper rig to play the animation.

1 Like

I don’t think that is possible.

1 Like

Is there a way to check if an animation isn’t playing on the rig because it is incorrect rig type?

if humanoid.RigType == Enum.HumanoidRigType.R6 then
	--play r6 animation
elseif humanoid.RigType == Enum.HumanoidRigType.R15 then
	--play r15 animation
end

You should just have two variants of each animation, one for R6 avatars and another for R15 avatars, I explicitly checked using an elseif in-case more avatar types are added in the future with fewer/more joints etc.

1 Like

That’s the exact same thing I sent. I don’t see the point competing for solutions.

2 Likes

I’m trying to make a system so the user can insert an animation ID and it will be previewed in the rig.

Essentially you should check the humanoid type before playing the animation, that way you don’t end up attempting to play an animation on an incorrect humanoid type.

1 Like

It isn’t currently possible to determine the compatibility of an AnimationTrack instance with a particular humanoid type (other than in the previous replies).

Is there a way to find whether an animation isn’t playing because it’s the wrong rig type?

AnimationTrack:Play() is a void function which means that it does not return a value, as such it would not be possible to determine if an animation is compatible with a particular avatar type by attempting to play the animation.

Okay so basically, Animation Tracks are incredibly rig specific. They are designed per rig, including non-default characters. (Think custom animation rigs)

They play and then move parts that the animation track can find that matches the ones defined in the animation. To my knowledge there isn’t a way to check if the rig is not animating, as it just attempts to animate parts that exist.

This is to prevent say a missing limb from throwing errors. The animation still plays even though it can’t find the parts.

Okay, but would it be possible to check whether a rig’s body parts are moving?

for _, v in pairs(rig:GetChildren()) do
    — code here
end

Technically, yes. However I don’t recommend this, as you’d need to scan every part constantly for the entire duration of the animation. Not to mention it isn’t foolproof either, blank animations would be inconclusive.

I would probably have to use this method, as there doesn’t seem to be another one.

Maybe I can speed up the animation to quickly scan it?

For the animations to even work, you would need to have ownership over the animations anyways. Because of this, you could just store what ID’s work for R6 and what ID’s work for R15 and deal with that accordingly.

2 Likes

I’m making a plugin for devs to quickly preview their animations. So they will probably only want to preview their own animations.

Considering that the Animation Editor already has this functionality, I don’t see a point to this.

2 Likes