As you probably can see in the video the ragdoll works pretty smoothly and i am kinda happy of how i turned out, BUT there is a problem after unragdolling the character, does anybody know what happens that makes the character fling like that?
I tried using someones else idea to fix this but it just didnt work
local root = character:FindFirstChild("HumanoidRootPart")
if root then
local liftY = 2
local position = root.Position + Vector3.new(0, liftY, 0)
local targetCFrame = CFrame.new(position) * CFrame.Angles(0, root.Orientation.Y, 0)
local tween = TweenService:Create(root, TweenInfo.new(.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
CFrame = targetCFrame
})
tween:Play()
tween.Completed:Wait()
end
task.wait(0.4)
local humanoid = character:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.PlatformStand = false
humanoid.AutoRotate = true
end
end
Thats the weird part. I also thought it would fix the issue however it didnt, i tried looking at forum for some other solutions but couldnt find any + i already do it earlier in the code.
Oh, wow that worked very well, thank you kind sir, but as it turns out there is another “glitch” or just a thing that i want to change is this kind of animation after the character gets up. what is it and what couses it? The character gets in the ground and performs this weird thing.
No problem! I’m glad it worked. Could you mark that it as the solution please?
And I think that weird “legs in the ground” thing is PlatformStand ending slightly after the character gets up? maybe try disabling PlatformStand something like 0.25 seconds before the rest of the “getting up” code…
That might be the character going back to its normal position after finishing the “getting up” animation? if I’m looking at the right thing (the character moving its arms, head legs in a strange way)
If that is what the issue is, this could work (it should get the idle animation and remove the weird transition we’re seeing):
for _, track in pairs(animator:GetPlayingAnimationTracks()) do
if track.Name:lower():find("idle") then
track:AdjustWeight(1, 0)
end
end