Underwater Muffle (Inspired by Polyhex)


#1

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:

or visit [https://streamable.com/9r37b] 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


#2

This is pretty cool!

the game isn’t uncopylocked though


#3

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


#4

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.


#5

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


#6

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


#7

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.


#8

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


#9

Great!


#10

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:.


#11

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


#12

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


#13

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


#14

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.


#15

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


#16

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


#17

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 :)!


#18

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.


#19

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