Body Gyro is not causing the fling, the fling happens with bodygyro disabled It happens either when I re enable motors or something
So mark a solution for the bodygyro???
Still got the probelm, the body gyro was half the issue I still cant get up
You’d have to enable the getup state and disable the ragdoll humanoid state? However, they’ve only worked for me by being set on the client.
Yikes that would mean I’d have to fire to the client for that alone, heres a clip of what happens. I’m not too familiar with what the Ragdolled state does since I’ve never changed the state to that or messed with it and I’m currently not using it but here
Once I actually get on my feet after flinging a few times I have ZERO control over the player and their limbs very slowly move back and forth a little amount for like 5 seconds then I regain control?
heres the code where my character ragdolls and gets up from the ragdoll if this helps
I tried bodyposition but that doesn’t seem fluid also obviously stops your player and fixes flinging but still gives the issue of no control on my player after getting up
local function Ragdoll ()
if not Character:GetAttribute("Dead") and not Character:GetAttribute("BeingCarried") and not Character:GetAttribute("BeingExecuted") then
if not Character:GetAttribute("Ragdolled") then
local YOrientation = HumanoidRootPart.Orientation.Y
local BodyGyro = Library.Functions.BodyGyro(HumanoidRootPart, CFrame.Angles(0, math.rad(YOrientation), 0), 10000, 500)
BodyGyro.Name = "BodyOrientation"
Debris:AddItem(BodyGyro, .25)
--local BodyPosition = Library.Functions.BodyPosition(HumanoidRootPart, HumanoidRootPart.Position)
--Debris:AddItem(BodyPosition, .25)
end
for _,v in pairs(Character:GetDescendants()) do
for _,v in pairs(CollisionGroup[Character]) do
v.CanCollide = Humanoid.PlatformStand
end
if v:IsA("Motor6D") and v.Name ~= "RootJoint" and not CollectionService:HasTag(v.Parent, "Accessories") and not CollectionService:HasTag(v.Parent.Parent, "Accessories") then
v.Enabled = not Humanoid.PlatformStand
end
end
end
end
Humanoid:GetPropertyChangedSignal("PlatformStand"):Connect(Ragdoll)
My ragdoll system doesn’t actually use platformstand, instead it manipulates the ragdoll state and the getup state meaning the player won’t getup then activate the getup state once unragdolled. However, it seems that the player is still in platformstand even after getting up via the bodygyro.
When I print platformStand it prints false the second I press G wich unragdolls me and that prints before and after the code above
Wait so how do you use the Ragdoll state to ragdoll? without platformstand on my player is above the world with it’s legs in the air? Not sure how the ragdoll state works sorry.
The wiki is bad at explaining states.
The ragdoll state is where the player has no control over their physics so therefore they cannot stand upright. You use ChangeState() to set it to ragdoll, and use SetStateEnabled() to disable the getup state. And basically do the opposite if you want to unragdoll.
Alright thanks let me try that really quick and see how it works out
I re-wrote the whole script in the style you said but the character can still jump and is standing up
Heres the module where I activate the states and such based on what I send to the module
function Status.Ragdoll(Character, ShouldRagdoll, Time)
if ShouldRagdoll then
Character:SetAttribute("Stunned", true)
Character:SetAttribute("Ragdolled", true)
Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, true)
Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
Character.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
if type(Time) ~= "number" then return end
coroutine.wrap(function()
wait(Time)
Character:SetAttribute("Stunned", false)
Character:SetAttribute("Ragdolled", false)
Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end)()
elseif not ShouldRagdoll then
Character:SetAttribute("Stunned", false)
Character:SetAttribute("Ragdolled", false)
Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end
--heres the ragdoll script when the stateenabled ragdoll is enabled, I added notes to make it more clear
--Ragdolled or GettingUp
local function Ragdoll (State, Enabled)
if State.Name == "Ragdoll" and not Character:GetAttribute("Dead") and not Character:GetAttribute("BeingCarried") and not Character:GetAttribute("BeingExecuted") then
--Getting Up
if not Enabled then
Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
local YOrientation = HumanoidRootPart.Orientation.Y
local BodyGyro = Library.Functions.BodyGyro(HumanoidRootPart, CFrame.Angles(0, math.rad(YOrientation), 0), 10000, 500)
BodyGyro.Name = "BodyOrientation"
Debris:AddItem(BodyGyro, .25)
--local BodyPosition = Library.Functions.BodyPosition(HumanoidRootPart, HumanoidRootPart.Position)
--Debris:AddItem(BodyPosition, .25
end
--Fake Limbs CanCollide with the world / Enabling - Disabling Motors
for _,v in pairs(Character:GetDescendants()) do
for _,v in pairs(CollisionGroup[Character]) do
v.CanCollide = Enabled
end
if v:IsA("Motor6D") and v.Name ~= "RootJoint" and not CollectionService:HasTag(v.Parent, "Accessories") and not CollectionService:HasTag(v.Parent.Parent, "Accessories") then
v.Enabled = not Enabled
end
end
end
end
--Activates the ragdoll function when the StateEnabled Ragdoll or GettingUp changes
Humanoid.StateEnabledChanged:Connect(Ragdoll)
Heres a gif of this aswell, https://gyazo.com/77689d830373c09d7258627ed59bdd5d
I wish this was easier or I had a better answer kinda sucks not knowing on something like this,
Tried a quick thing where I set the states on the client and it kinda worked but I got back up for some reason gonna try a client sided version of this ragdoll thing
I’m assuming this was set on the server correct?
The issue actually is now that I fixed the fling I think? The ragdoll state after being set doesn’t set back did I do something wrong here?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = game:GetService("Players").LocalPlayer
ReplicatedStorage.Remotes.Ragdoll.OnClientEvent:Connect(function(Ragdolled)
if Ragdolled then
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, true)
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
Player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
elseif not Ragdolled then
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
Player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end)
Honestly I don’t even see the point using bodygyro in my combat system it uses CFrame to set the player CFrame. It also works with NPC’s. Fighting - Roblox(Link to the game) There are probably a lot more humanoid states that mess around and prevent the player physics.
Can you tell me the alternative you use to it? I apreciate the help btw.
The alternative to what? I can give you an uncopylocked version of the game. Though the code isn’t necessarily nice to read.
Fixed that thing
Just played your game, yeah the thing is when I unragdoll I want to get up facing the way I already was and not cframe instantly I want to kind of rotate up from the ground,
Maybe a animation?
It is probably best to use an animation for that. Using bodygyro just doesn’t seem practical.