Hi! I am making a Flood Escape 2 like water system. I am currently having trouble with getting player parts to float inside of water after death, but I still want to have the character parts fall apart. Is there any way to do this? I have messed with VectorForces, BodyForces, Velocity/AssemblyLinearVelocity, but nothing has seemed to work.
Try using a while loop and putting the character root part position at the end of the water part.
What? Put the character root part position at the end of the water part…?? Also, repeat until seems more promising. LOL
Also, it works on accessories, but seemingly not body parts.
No, I’m saying I just don’t understand why I’d do that.
repeat task.wait() regenCooldown = 10 -- Permanently sets air regen cooldown to 10 so the player can't gain air while dead
for i,v : Part in pairs(head.Parent:GetDescendants()) do
if v.Name == "Handle" or v.Name:find(" Leg") or v.Name:find(" Arm") or v.Name == "Torso" or v.Name == "Head" then
v.AssemblyLinearVelocity *= Vector3.new(1/3,1/3,1/3)
end
end
until false
Just read it again, you can do Humanoid.Died and use a for loop, how ever I’m not sure how’d you float it up with the same X and Y.
Just read it again.
I think that’s the issue- I need to you reword it perhaps?
I would recommend parenting a body force inside each body part with an upwards force, and if the body parts go above the top of the water part (WaterPart.Size.Y / 2), set the body force to either (0, 0, 0) or a force similar or less than the rate of the water’s rising speed. You can achieve this by using a while loop and toggling between an upwards body force and neutral/lesser body force by using an if-then-else statement.
Did you read my post…?
Is there any way to do this? I have messed with VectorForces, BodyForces, Velocity/AssemblyLinearVelocity, but nothing has seemed to work.
I feel like I should save all of the velocities of the parts on death and divide them by a large-ish number to prevent them from falling.
I don’t understand. Do you not want to use BodyMovers? I just assumed that based on the way you wrote it you were unsuccessful with them so I was providing a way that in my mind would work.
No. I am having trouble with using anything that involves velocity - it only works for the accessories, but nothing else, even when I directly edit the velocities themselves.
Is this Terrain Water?
When you say ‘float inside of water after death’ do you mean you want them to float to the surface, or stay where the player died under the water?
Why not just set the body parts Density to less than 1 if you want them to float to the surface, or set them to 1 if you want them to stay submerged at the same location as when the player died.
They are Parts, not Terrain Water.
This is the issue:
Because it is water, I want to make the dead player’s body parts float without falling down, as well as moving at a heavily decreased velocity or speed, but even directly editing their velocities doesn’t work.
What method are you using to change the velocities?
…I already provided some code?
I tested this and my body parts fell slowly, hopefully this works for you:
for i,v : Part in pairs(head.Parent:GetDescendants()) do
if v:IsA("BasePart") then
task.spawn(function()
while v.Parent do
v.AssemblyLinearVelocity *= Vector3.new(1/3,1/3,1/3)
task.wait()
end
end)
end
end
Hold on. It doesn’t work, but I’m building something into an if statement…
Nope- nearly crashed.
I see that you edited your message. However, if you’re wondering what the desired outcome should look like, it looks like this:
That’s odd. How come it doesn’t work for me even after editing it?
The accessories always seem to work, but the body parts never work- they always fall while the Humanoid is dead.
Have you tried adding VectorForce to each Part with the code supplied here: How do i make players weightless and float in the air? - #3 by Redluo