How would i go across preventing the player from floating up in water?

I’m working on a world in my game where it involves the player swimming but they’re in a giant water cube so it has a fog-like effect or whatnot, However, The player floats to the ceiling most times and I looked for other posts regarding this issue and the last thing i found about it was from 2019.

I’m relatively new to scripting these types of things, and I’m wondering if theres a way to at least limit how much the player goes up, I’ve messed with Workspace’s gravity and couldn’t do anything there, It worked fine when i adjusted it in-game, But when i set it in workspace then tested, It pretty much acted like normal.

I saw something about density and setting a property like such into each part of your player, This is that code (was from a 2019 post.)

The below is in a local script
Does anyone have any idea how I could go across this?

local Player = game:GetService("Players").LocalPlayer
repeat wait() until Player.Character ~= nil 
Character = Player.Character

game:GetService("Players").PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Char)
		wait()
		for i,v in pairs(Char:GetDescendants()) do
			if v:IsA("BasePart") then
				v.CustomPhysicalProperties = PhysicalProperties.new(1,0.3,0.5)
			end
		end
	end)
end)
2 Likes

I have seen a similar post on the dev forum dose this help ?