Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I create a float-able water?

Asked by 9 years ago

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.

0
This is an interesting question. Do you really need the player to "float", or would a part below the surface be good enough? BlueTaslem 18071 — 9y
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"? chess123mate 5873 — 9y
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. Perci1 4988 — 9y
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. InfraredChasm 35 — 9y
0
Still can't figure it out... InfraredChasm 35 — 9y

1 answer

Log in to vote
-2
Answered by 9 years ago

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.

0
Please rep me up/ nstrike159 15 — 9y
Ad

Answer this question