R6 and R15 animation if statement?

Is it possible to have a if statement for - If the player is a R6 Avatar type then play this animation, and If the player is a R15 Avatar type then play another animation.
Would this be possible with Player Choice on?

3 Likes
if humanoid.RigType == Enum.HumanoidRigType.R6 then
	--is R6
else
	--is R15
end
15 Likes

Would I put this in starter player scripts?

It depends on your code, although it could work with both server / client scripts.

2 Likes

It all depends on when you want to fire the animation. I would say use this check when you make an animation instance. If it is R6, change it’s AnimationId to the R6, vice versa.

local player = game.Players.LocalPlayer
local character = player.Character
local hum = character:WaitForChild("Humanoid")

local animation = Instance.new("Animation")

if hum.RigType == Enum.HumanoidRigType.R6 then
	animation.AnimationId = "rbxassetid://0000" --R6 Animation
else
	animation.AnimationId = "rbxassetid://0000" --R15 Animation
end

local animTrack = hum:LoadAnimation(animation)
animTrack:Play()
animation:Destroy()

It just all depends on what you want to do, don’t use this if it’s not what you’re looking for. It’s just an example.

4 Likes

Yes I plan to make two different walking animations for each rig.