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
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?
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.
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.
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.