How would I fix Skinned Meshes imported from Mixamo from T-posing when fading animations?8

When using the fade time parameter of AnimationTrack:Play(fade, weight, speed), animations that I have imported from Mixamo start T-posing before the actual animation plays when the fade time is above 0.1. But, if I set it to 0.1 or 0, the animation snaps and does not look smooth.

Edit - Wrong Video woops
robloxapp-20240627-1922113.wmv (1.1 MB)

– script used for fading the anim :smiley:

-- Players
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")

-- Anims
local Idle = script.Idle
local Walk = script.Walk
local Run = script.Run

-- table
local animtable = {
	animator:LoadAnimation(Idle),
	animator:LoadAnimation(Walk),
	animator:LoadAnimation(Run)
}

humanoid.Running:Connect(function(speed)
	if speed < 1 then
		for i, v in ipairs(animtable) do
			if v.Name == "Idle" then
				v:Play(0.5, 1)
			else
				v:Stop()
			end
		end
	end
	if speed > 1 and speed < 10 then
		for i, v in ipairs(animtable) do
			if v.Name == "Walk" then
				v:Play(0.5, 1)
			else
				v:Stop()
			end
		end
	end
end)
2 Likes

Found a okay-ish fix. Smoothly blends into each other, but instead of doing AnimationTrack:Stop(), I constantly run the animation and adjust the weight instead, so if u want the animation to replay again from the start rather than midway, then figure it out yourself, sorry.

robloxapp-20240627-2137210.wmv (2.7 MB)

-- Services
local RunService = game:GetService("RunService")

-- Players
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")

-- Anims
local Idle = script.Idle
local Walk = script.Walk
local Run = script.Run

-- table
local animtable = {
	["Idle"] = animator:LoadAnimation(Idle),
	["Walk"] = animator:LoadAnimation(Walk),
	["Run"] = animator:LoadAnimation(Run)
}

for _, v in animtable do
	v:Play( 0, 0.01, 1)
end

humanoid.Running:Connect(function(speed)
	if speed < 1 then
		for i, v in pairs(animtable) do
			if v.Name == "Idle" then
				v:AdjustWeight(1, 0.4)
			else
				v:AdjustWeight(0.01, 0.4)
			end
		end
	end

	if speed > 1 and speed < 10 then
		for i, v in pairs(animtable) do
			if v.Name == "Walk" then
				v:AdjustWeight(1, 0.4)
			else
				v:AdjustWeight(0.01, 0.4)
			end
		end
	end

	if speed > 10 then
		for i, v in pairs(animtable) do
			if v.Name == "Run" then
				v:AdjustWeight(1, 0.4)
			else
				v:AdjustWeight(0.01, 0.4)
			end
		end
	end
end)

1 Like

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