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

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

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

5 comments

0

trying to make something like arcane adventures?

0

No. It's a scenario thing , so when players get in water they don't fall off the map.

0

Your title is confusing, are you trying to make a block appear when the player is in water... Or something else?

0

Tons of Free Models out there, with this. Check out a life vest or something

0

The block would be water.

3 answers

✓ Accepted answer

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

2 comments

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.

0

it's ok man, you're new to scripting

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.

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

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