I’m going to do a knockback like you see in a combat/fighting games. After the Ragdoll function is fired after a few times, the NPC (as seen in the video) stands up even though they’re ragdolling.
Is there a way around this? I’ve tried using Humanoid.PlatformStand = false instead of Humanoid:SetStateEnabled(). This has lead me to believe that it must be the Body/LinearVelocity or the Character being massless. The parts of the character being massless was only put into place to prevent friction.
This is a snippet of the two modules:
--//Ragdolling\\--
function Character_Module.Ragdoll(Character: Model, Died: boolean, Duration: number)
local Player = Players:GetPlayerFromCharacter(Character)
local StoredJoints = {}
local Humanoid = Character.Humanoid
if Died then
if Player then
Character.Archivable = true
local Player = Players:GetPlayerFromCharacter(Character)
local Ragdoll_Dummy = Character:Clone()
Ragdoll_Dummy.Name = "Ragdoll ("..Ragdoll_Dummy.Name..")"
Ragdoll_Dummy.Parent = workspace
Ragdoll_Dummy.Humanoid.BreakJointsOnDeath = false
Ragdoll_Dummy.Humanoid.RequiresNeck = false
Add_RagdollConstraints(Ragdoll_Dummy, Died, StoredJoints)
for _, Descendant in pairs(Character:GetDescendants()) do
if Descendant:IsA("BasePart") then
Descendant.Transparency = 1
Descendant.CanCollide = false
elseif Descendant:IsA("Accessory") or Descendant:IsA("ShirtGraphic") or Descendant:IsA("Shirt") or Descendant:IsA("Pants") or Descendant:IsA("Decal") then
Descendant:Destroy()
end
end
Camera.CameraSubject = Ragdoll_Dummy.Torso
Character_Module.FadeOut(Ragdoll_Dummy, Players.RespawnTime/2, Died)
else
Humanoid.BreakJointsOnDeath = false
Humanoid.RequiresNeck = false
Add_RagdollConstraints(Character, Died, StoredJoints)
Character_Module.FadeOut(Character, 2, Died)
end
else
Humanoid:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding, true)
Add_RagdollConstraints(Character, false, StoredJoints)
task.delay(Duration, function()
Delete_RagdollConstraints(Character, StoredJoints)
--Makes the player stand upright.
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end)
end
end
--//BodyMovers\\--
function BodyMovers.create_BodyVelocity(
Name: string,
Parent: Instance,
MaxForce_X: number,
MaxForce_Y: number,
MaxForce_Z: number,
Velocity: Vector3,
Duration: number
)
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Name = Name.."Velocity"
BodyVelocity.Parent = Parent
BodyVelocity.MaxForce = Vector3.new(MaxForce_X, MaxForce_Y, MaxForce_Z)
BodyVelocity.Velocity = Velocity
--//Preventing Character Friction\\--
if Parent.Name == "HumanoidRootPart" then
local Character = Parent.Parent
local Humanoid = Character.Humanoid
for _, BasePart in pairs(Character:GetDescendants()) do
if BasePart:IsA("BasePart") then
BasePart.Massless = true
task.delay(Duration, function() BasePart.Massless = false end)
end
end
Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false) --Prevents flinging
end
if Duration then Debris:AddItem(BodyVelocity, Duration) end
end