Underwater Muffle (Inspired by Polyhex)

So exactly a month ago, Polyhex posted a video of some of the stuff he’s been working on.

Part of the functionalities he’s posted was this super dope underwater muffle effect when the character goes underwater. Of course, I’ve been wanting to recreate it, and after a month, I finally decided to! :tada:

In this ^ linked game, you can try out the muffle effect when you go into the water.

Here’s a Video showcasing it:

External Media

or visit [Watch UnderwaterDemo | Streamable] if the video doesn’t work.

Now, I won’t torture you by showing this off and not letting you try it in games yourself! You’ll find that the place I linked is un-copylocked, so feel free to use everything! (Don’t torture me about my coding methods though, please?)


Also, heavy credit to that amazing dude called @Polyhex, see more of his cool stuff on his twitter!

https://twitter.com/PolyhexGames

69 Likes

This is pretty cool!

the game isn’t uncopylocked though

6 Likes

Huh, must of uncopylocked a different place by accident. Check again, sorry about that! :sweat_smile:

5 Likes

Very cool concept, simple but effective.

One tiny thing is that the prints aren’t commented so it leads to a bit of spam but it’s very minor.

1 Like

Yeah feel free to remove those. And glad you like it!

1 Like

We just recently implemented a similar feature in Vesteria. 2018 is the year of water muffling!

11 Likes

I updated the place with a little more explanation, and a ReadMe. I’ve moved this to #learning-resources:community-tutorials-resources as well!


On another note,

Woah, it does look like everyone’s doing that now! It’d be interesting to know how many different approaches were taken to reach the same goal :grin:. I suffered a bit learning about regions, and how to check if they touch terrain, but the result is awesome.

This is really cool! Would be better if it only got muffled if your head was in the water

1 Like

Great!

That would be an easy change. I intentionally made it so only if the camera was under water would the dulling play. The muffle sound pairs up with the visual underwater appearance :man_shrugging:.

Now if only we could get the wave height of water at a position so this could work with anything but completely flat water :c

5 Likes

Yeah, that’s the downside, although personally, I find the wavesize at any value a bit unnoticeable

I’ve requested it because it’d really open up a lot of new doors with water based games, or really any game with water for that matter.

You could make things float more realistically. I hope it’s eventually considered one day

3 Likes

I heavily support you. Having some sort of way to bind the position and orientation to the normal of a certain water region, or even getting the formula for the waves (something like a sine graph) would be totally epic.

I realized that when is said “I find the wavesize at any value a bit unnoticeable” was a bit vague. I meant that when the camera blurs in and out, the area of being “out of water” and still experiencing the effect or vice versa is very unnoticeable.

The formula wouldn’t be enough, waves are connected to an internal clock/timer that we can’t use or access.

Just a method to get the current wave height at a certain world space vector2 or 3 would be incredible

2 Likes

Well. That’s cool. Had this feature in my old game (Pokemon Advaced). Also implemented music effects to make it more funny. @Primpy

1 Like

This is great! I only have one complaint -
When you go underwater, not only should the sound be muffled, but it should also become noticeably quieter, it kinda threw me off when it was the same volume with a muffle

other than that , its great :)!

1 Like

I’ve set up a little read me that tells you how to customize the water muffling to your liking, especially since everyone has a different thing they’d like to have different haha.

1 Like

yeah i’ve also made a video tutorial on how to do this here

3 Likes