Download

Water Splash with BP Actor

So I’d like to make the actor I have (which is a plane with a water material) execute a splash whenever the player which is inside the actor moves, or for example, a rock falls on the water, I’ve been messing around with the Hit and BeginOverlap components and emmiters and sounds, but I can’t seem to get what I want.

I’ve made it so when the player enters the actor the sound emits, but it’s just once, and once the player is inside the water moving around, nothing happens, anyone knows a good way to solve this problem?

Can you post your blueprints? Is your sound file set to loop?

It isn’t, but either way I’d like to do this with effects, not sounds, that was just to test what I should use, BeginHit or BeginOverlap.

“begin overlap” only fires when the overlapping first occurs - and as you noticed that is only once - so if your character stays in water that event will not fire again. if you constantly wanna fire effects or particles you could use “tick”, but I’d probably use a delay of a few ms to keep the resource use rather low. And keep a variable (vector) with the last player character coordinates, so you only fire more particles if the X/Y has changed (moved).

See this FAQ (Different action, but similar problem):

https://answers.unrealengine.com/questions/545507/overlap-triggering-every-tick.html

I would set a boolean indicating that the Character is in water whenever the Begin Overlap is fired. Then sync the sounds with your animations with Events rather than using Vectors or similar. This way you will get a proper handling without “weird logic” laying around.

For Static Actors such as a Stone, the Begin Overlap should be enough since there really is not much sound going on while a Rock is descending in water with Gravity. Otherwise in this case I would use the same method setting a Boolean indicating change of state and then looking at the Velocity to increase Sound Amplitude or similar. Ofc depending on what you try to achieve here.

What if my character moves while in the water and then stops?

In this case you would know that the Character is in water (the boolean is true since you passed BeginOverlap) and you should check the Speed which is zero in this case.

However syncing the sound effects with your Swimming animations (as proposed) would still handle this if you traverse to a Idle animation without OnNotify Events when Character stops moving.
The sounds would only fire whenever the Character does the Swimming Animation in this way.

Why don’t you use “GetOverlappingActors” of your plane and check every tick if there is one?
For each Overlapping Actor do your stuff.

Because when I’m standing still that would still activate it.

Use BeginOverlap for your splash.

Use Tick->getOverlappingActors for your ripples.
Keep in mind that you can check the OverlappingActor’s Velocity to fire Ripples only when they move.