Hello. I’ve run into an issue, and I’ve run into a similar one in my last project.
Basically, there are a lot of explosions in the game, custom ones, not the roblox ones. They basically do two things, add bodyvelocity force from the lookvector of two points, AND do ragdoll.
So the player kinda blasts away flying ragdolly.
The issue is, in my last project, there was a RARE occasion where this would make the HumanoidRootPart disconnect from the body, basically, your soul would leave your body, flying.
I thought it was possibly the ragdoll code, so I used a different one for this new project. But…
Similar problem, except now the entire player deletes themselves as soon as the explosion hits. Just poof. Gone. As if someone just Ctrl-deleted them.
I’m sure it’s not the ragdoll script, I’m just wondering if anyone has some insight with this.
Am I adding force not correctly? Is adding velocity to ragdolls not good?
Here’s the code for the knockback on the explosion:
local fly = Instance.new(“BodyVelocity”,workspace)
fly.Parent = v.HumanoidRootPart
fly.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
fly.Velocity = CFrame.new(v.HumanoidRootPart.Position,part.Position).LookVector * -100 + Vector3.new(0,75,0)
Keep in mind this happens only SOMETIMES. I can’t pinpoint what causes it, I did a lot of testing with it, and the only thing I can say is… It seems to happen more (I think) when you are extremely close to the explosion. This is not certain though.
I’ve already tried:
-Changing the maxforce
-Adding delay on the ragdoll and or force
-It’s not the ragdoll, because I’ve changed it twice now.