I need to be able to allow a character to neither sink nor float in terrain water.
I have seen several posts about this, but none of the solutions seem to work.
Some suggest, setting custom physics on all base parts to 1, when player.Character.Added fires, others suggest when player.CharacterAppearanceLoaded fires
Then some suggest changing the parts to 1 but doing it on the client, under render stepped.
Others suggest, that 1 is not the correct value for density but rather .92 or other altered numbers.
None of this works consistently between avatars. If I set the proper value for one avatar, then I log in with a different avatar, the numbers don’t work.
So there must be some sort of formula, I would hope, that could calculate what density I need to set the parts to, dependent upon avatar, to achieve neither sinking or floating, but to just remain stable.
If all of your terrain is made of water, you can assign a CollisionGroup to it to prevent all collisions.
Otherwise, try Humanoid:SetStateEnabled, and disable the swimming state. Then, set the CustomPhysicalProperties.Density of the HumanoidRootPart to something like 5.
Are you setting every child Part of the Avatar to Density 1 including the accessories?
Water Density is 1 so if every single Part in the Avatar is 1 (I’m not sure about Massless items though) then the Avatar should stay at the same level.
When you are testing click on your avatar in the Explorer window and have a look at the Density of the Parts there.
I think I heard that if you just change a Humanoid Property it will just change back in the next heartbeat. Check the actual player part properties while playing to see if the Density is 1 or something different.
Well, I have tried it several ways, I tried it where the server sets it when your character loads, and when in studio, if I click in explorer, it shows it to stay set.
But I heard the same thing you did, so I also added a client script where each frame I set it all again to a density of 1, still I sink
Try this script, works for most if not all avatars, since it doesn’t depend on avatar but rather corrects values according to the rate at which the avatar sinks/raises!