I was trying to make a different version of FE2, might want to check it out, and i tried to make players float in the water. I have a script in StarterCharacterScripts and inside it has a Water.Touched function and a Water.TouchEnded function as seen here:
head.Touched:connect(function(hit) if hit:FindFirstChild('_Water') then print('Hit By Water!') TouchingWater = true CurrentWater = hit WaterState = hit.State.Value local bodyforce = Instance.new("BodyForce") bodyforce.Parent = head.Parent.HumanoidRootPart bodyforce.Name = 'BodyForce' bodyforce.Force = Vector3.new(0, 20000, 0) end end) head.TouchEnded:connect(function(hit) if hit:FindFirstChild('_Water') then if head.Position.Y > hit.Position.Y then TouchingWater = false CurrentWater = nil WaterState = 'Water' head.Parent.HumanoidRootPart.BodyForce:Destroy() end end end)
It does create the bodyforce however it only moves the player up when they jump. I don't know how to fix or change this and yes theres another one that said the same thing from 4 years ago. I have tried using workspace. Gravity but i couldn't get it to work right. If I should use workspace.Gravity show me a example of how it would work. This is in a normal script not a local script.