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

Is there any how to make a player floating on a block like water?

Asked by 7 years ago

I'm still a learner and trying to progress. This would help me a lot in my projects.

0
trying to make something like arcane adventures? SwordsDestinyGames -11 — 7y
0
No. It's a scenario thing , so when players get in water they don't fall off the map. ArcanZus 61 — 7y
0
Your title is confusing, are you trying to make a block appear when the player is in water... Or something else? Vingam_Securis 213 — 7y
0
Tons of Free Models out there, with this. Check out a life vest or something Shawnyg 4330 — 7y
0
The block would be water. ArcanZus 61 — 7y

3 answers

Log in to vote
0
Answered by
Stadow 30
7 years ago

To be honest i don't know too much of what you're asking, I recommend adding extra details in your description about your question and what you've tried so far. To me it looks like you're asking for how to make a block float on water with the water which i think there is an algorithm for water that goes something like this

local x, z = 0, 0
RunService.RenderStepped:connect(function()
    y = 1.8 * math.sin((math.pi * 2) / 85 * x * game.Workspace.Terrain.WaterWaveSpeed / 10) * math.sin((math.pi * 2) / 85 * z * game.Workspace.Terrain.WaterWaveSpeed / 10) + 15
    x = x + 0.18
    z = z + 0.18
    Ship.Position = Vector3.new(0, y, 0);
end);

i hope this helped, it might not have because i didn't fully understand what you're asking

0
Thanks Stadow, sorry for my confusing description, I just want to make water without the Terrain thing and make people float on this water. ArcanZus 61 — 7y
0
it's ok man, you're new to scripting Stadow 30 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

You might consider using a Touch event (of the water block(s)) to start monitoring a player's position. While they are in the water, you could have a BodyPosition in their character that only impacts their Y coordinate and targets where you want them to float. When they get out of the water, you'll need to remove the BodyPosition.

If you wanted them to float up/down (as if floating over waves), you could combine this idea with Stadow's script.

Log in to vote
0
Answered by 7 years ago

You should use a touched event for when the player touches the water therefore calling a part to the position of the players feet make sure to make it a infinite loop until the player gets out of the water

Answer this question