Terrain:GetWaveHeight(Vector3)

The Problem

As a Roblox developer, it is currently impossible to get a reliable wave height for smooth terrain given a position , that respects water wave size and speed.

Smooth terrain water waves don’t have any physics whatsoever, and are purely visual. They look neat, but make buoyancy look awful if you don’t have a game with flat water…

The Solution

If we were able to at least have a function that could get a water wave height at a certain position, or have raycast support for waves, we could give objects more realistic buoyancy.

Some Use Cases

  • Better swimming mechanics for players and sea life
  • More realistic boats

Why do we Need it?

As far as I’m aware, this is absolutely impossible to do in lua right now. Smooth terrain water seems to work off phase shifts and clocks we can’t access or even possibly sync to in game.

Even in the camera code which respects waves is not accessible or usable for this.

I don’t believe it makes any sense to give us an option to have waves in our games if those waves can’t actually do anything besides look pretty.

Thanks!

25 Likes

It would help your request if you provide a few use cases.

1 Like

My use case is making buoyant objects actually float, not just on a flat voxel surface but on top of the actual water it sits on… as it should.

Why have waves if they don’t do anything?

Of course this is nothing game breaking, but it’s something I still feel is necessary

3 Likes

“Use cases.” In case of feature requests, having more than one use case will extremely help your case. In this instance, it’s mainly just buoyancy but you could definitely elaborate on that, such as more realistic boats and swimming mechanics.

2 Likes

I had wanted this for a fishing game I worked on in the past – would have been really cool to have the bobber bob up and down with the waves.

5 Likes

Y’all can take a stab at leveraging this solution: https://devforum.roblox.com/t/how-to-get-wave-height-at-a-specific-position/30672/5

IMO, waves have such a high frequency and not enough volume to them that you wouldn’t do much good with this, even if it were to be implemented. And perfectionist Vector3 you can get will only help minor aesthetics, I don’t see any use case where you could use it mathematically to improve gameplay mechanics.
I suggest you go with a wave direction and make a boat rock using that. A boat is bigger than the waves anyways.

I believe @Fluffmiceter did something like this with a script. It was either fluff or someone else.

I’d love this for a project I’m working on where it’s a naval game and I’d like to have the ships travel with the waves to provide more fluid movement. It’d especially look amazing in storms with rough tides with the ships bobbing up and down frequently.

3 Likes

I need this.

https://devforum.roblox.com/t/how-to-get-wave-height-at-a-specific-position/30672/5

The above solution only works for graphic levels 8 or above.

3 Likes