Answers for "roblox how to play animation in my game"

5

how to play an animation roblox

local function PlayAnimation(character, animation)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if humanoid then
		-- need to use animation object for server access
		local animator = humanoid:FindFirstChildOfClass("Animator")
		if animator then
			local animationTrack = animator:LoadAnimation(animation)
			animationTrack:Play()
			return animationTrack
		end
	end
end
Posted by: Guest on June-12-2021

Code answers related to "roblox how to play animation in my game"

Browse Popular Code Answers by Language