High performance water: Swimmable part 2.0

how can I make it so it always pushes them to the surface rather than just when they are idle or pressing space?

Thanks for this. I’ve made my own addition so that it works on large scale projects. Mine is tens of thousands of studs. Seems to work without error. Although I have not done a thorough test.

task.spawn(function()
	while task.wait() do
		local waterParts = workspace:FindFirstChild("WaterParts")
		if not waterParts then
			return
		end
		
		for _, part in waterParts:GetChildren() do
if not script.Parent:FindFirstChild("HumanoidRootPart") then
				continue
			end
			local distance = (part.Position - script.Parent.PrimaryPart.Position).Magnitude
			if distance > part.Size.X and distance > part.Size.Z then
				continue
			end
			local foundLimb
			local parts = workspace:GetPartsInPart(part)
			for _, limb in parts do
				if limb.Parent:IsA("Model") and game.Players:GetPlayerFromCharacter(limb.Parent) then
					foundLimb = true
					
					if zones[part] then
						continue
					else
						zones[part] = zonePlus.new(container)
					end
				end
			end
			if not foundLimb and zones[part] then
				zones[part]:Destroy()
				zones[part] = nil
			end
		end
	end
end)```
1 Like