Attempting to make character parts float after dying inside of a water part

I am trying to say that it seems like the body parts of a dead Humanoid are forced to fall no matter what their velocity is set to.

Are you sure that the said body parts are being affected by the script? Maybe try printing the value of v in the for loop just to confirm itā€™s not something else?

1 Like

Yes, but Iā€™m not talking about setting the Velocity. Iā€™m talking about adding a VectorForce that counteracts the gravity in a game.

I have. Iā€™m going to try using BodyVelocities to force velocities and see if it lets me.

1 Like

Roblox seems to force the part to fall even with a BodyVelocity and what I just coded.

Giving up for now because Roblox will not let me change the velocity of the parts no matter what I do.

1 Like

But why are you stuck on using BodyVelocity? I believe I saw it used in a train I was helping another player with and it had to be set every frame to keep it working.

Every playerā€™s Parts arenā€™t going to have the same Mass.
The post I recommended takes Mass into consideration along with VectorForce as well as the place Gravity to float the player.
You can just go through all the playerā€™s Parts and add a VectorForce to each one base on its Mass.

Iā€™m not stuck on thatā€¦ Iā€™m stuck on not being able to change any of the body partsā€™ velocities whether I change the velocities directly or use an Instance like VectorForce or BodyVelocity to change the velocities. Also, all of the parts in the character are set to Massless anyways (I added a function to change all of the parts in the Character to Massless in the swim script on spawn, I know they arenā€™t like that by default).

local Humanoid = --humanoid here
local WaterName = --watername Ex. "Water" or "WaterPart"
local RiseSpeed = 0.1 --set to a negative number to float down instead of up
Humanoid.Died:Connect(function()
for i, Part in pairs(Humanoid.Parent:GetChildren()) do
if Part:IsA("BasePart") then
Part.Anchored = true --so no wonky CFrame stuff happens
game.RunService.Heartbeat:Connect(function()
if table.find(Part:GetTouchingParts(),WaterName) then
Part.CFrame += CFrame.new(0,RiseSpeed,0)
end
end)
end
end)

This is something I came up with if none of the velocities work lol.

I casually forgot I couldā€™ve anchored. Setting as solution so maybe I can do something with it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.