Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I create a float-able water?

I've currently tried to use Body Position in which I tried to make the player go up and down for a bobbing effect

stop = false

script.Parent.Touched:connect(function(toucher)
	local torso = toucher.Parent:FindFirstChild("Torso")
	local bp = Instance.new("BodyPosition", torso)
	bp.P = 1000000000
	repeat
		bp.position = Vector3.new(torso.Position.X, script.Parent.Position.Y * 2, torso.Position.Z)
		wait(0.25)
		bp.position = Vector3.new(torso.Position.X, script.Parent.Position.Y * 0.5, torso.Position.Z)
		wait(0.25)
	until stop == true
	game.Debris:AddItem(bp, 1)
	stop = false
end)

script.Parent.TouchEnded:connect(function()
	stop = true
end)

which did actually push me up and down but it wouldn't keep me floating.

I've also used Body Velocity where I tried to do the exact same thing as the one I did with Body Position

stop = false

script.Parent.Touched:connect(function(toucher)
	local torso = toucher.Parent:FindFirstChild("Torso")
	local bv = Instance.new("BodyVelocity", torso)
	bv.P = 1000000000
	repeat
		bv.velocity = Vector3.new(torso.Position.X, script.Parent.Position.Y * 2, torso.Position.Z)
		wait(0.5)
		bv.velocity = Vector3.new(torso.Position.X, script.Parent.Position.Y * 0.5, torso.Position.Z)
		wait(0.5)
	until stop == true
	stop = false
	game.Debris:AddItem(bv, 0.025)
end)

script.Parent.TouchEnded:connect(function(toucher)
	stop = true
end)

but it wouldn't keep me floating.

So what do I have to do so it gives me the bobbing effect and keep me afloat? The roblox water looks bad and I don't want to have that swimming effect.

5 comments

0

This is an interesting question. Do you really need the player to "float", or would a part below the surface be good enough?

0

What do you mean, exactly, by "but it wouldn't keep me floating"? What is happening vs what you want? Are you referring to the "swimming effect"?

0

I've tried this so many time and came to the conclusion that body movers are a freakin' pain in the butt. I hope you get a good answer.

0

A part below the surface wouldn't be swimming though. I want the players to float. Also, all that happens is that it just makes me glide down instead of actually bobbing me back up.

0

Still can't figure it out...

1 answer

You would also need to set the force of the BodyPosition's force property for it to be able to support a characters weight go here for more information in body movers.

1 comment

0

Please rep me up/

This discussion is preserved as it was. New answers, comments, and votes are closed.