Water Volume: all effects necessary for convincing water entry

I followed this basic tutorial on creating a swim-able water volume, but I want to do much more with this:

1 - Feet splash effect when walking over the water, but not yet swimming
2 - Bigger splash effect when first swimming in the water
3 - Looping effects when swimming above the surface
4 - Looping effects when swimming below the surface
5a - Particle+sound effect when walking out of the water (can be replicated from state #1-3)
5b - Different particle+sound effect when leaping out of the water

At the moment, I have anim notifies in the animation blueprint for all sorts of decal footprint spawning, particle effects, and even dynamic materials on the character that all change according to the physical materials. Unfortunately, I’m at a loss trying to reference a hit detection with a water volume as opposed to a solid surface. I can’t seem to reference world objects in the animation blueprint, either, so if there’s a way to ensure that any time the character steps on, or enters a body of water have that activate an event, that would be awesome, and I could get started working on all of the above!

I have a basic beach splash system going.

You can see the splash in action here: http://www.youtube.com/watch?v=EbpXD3VZDy0 from 1:30 - 1:45

I just catch the overlap event and spawn the splashes and sound at the actor location, with Z set to water height (0 in my case).

Wow, thanks! A couple questions: how can I call an animation blueprint in a separate blueprint? I can’t seem to do what you’re able to do above, it seems like the animation blueprint cannot communicate with the level, or something. Also, I’d like to make this blueprint work for any water-physics volume in the game: must this be placed in the persistent level, or can I attach it to the character itself?

Inter-blueprint communication can be difficult to get your head around if you don’t have a programming background, and because there are many ways of doing it. Also the way it works between blueprints that are “in the world” as instantiated objects versus blueprints that are not immediately in the world is different. I’d suggest you go through the online documentation around communication options here: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/BlueprintComms/index.html

The most flexible way to communicate between blueprints is via blueprint interfaces, and through broadcast events, as this communication is dynamic, but to get the job done you just need to make sure you have a populated reference to the blueprint you require:

  1. For communication between blueprints already placed in your world, create a local variable in one blueprint of the same type as the one you want to talk to, and assign it in the editor details tab after compiling. That’s direct. For communication from level blueprint to blueprint, you can just drag a reference from your world outliner and drop it directly into your blueprint and then reference (get or set) it’s properties.

  2. For communication with a blueprint not already in your world (but is created at runtime, e.g. spawning objects) you can loop through all objects of the class looking for the one you want, cast to it if it has a child class, and set it’s properties directly.

  3. for communication with certain predefined types of blueprints that you can access via things like GetPlayerCharacter or GetPlayerController, just create a local blueprint variable of the right type, and set it on the Event Begin Play of the character (or whatever blueprint you require them) and you can reference them via the variable within the blueprint.

For the example above, I use 3) when my character begins, I create a reference to the AnimationBlueprint and store it in a local variable AnimBP which I can access at any time later.

Good luck.

In answer to your other question, if you want to trigger overlap events with anything in your world, I think you need to do it in the level blueprint… since the thing you are overlapping belongs to the level. Different story if you have two objects colliding, you can trap overlap events within the object blueprint. You could also assign your trigger volume along with the object into a new blueprint, and do the overlap event within the new blueprint.
Either way, you get a unique overlap event triggered for each volume so you can set them separately, i.e. one for the ocean, another one for a pool, another one for a lake, etc. I wouldn’t attach it to the character, as you will then be triggering an overlap event every time you’re characters collides with anything at all and having to check what it is first, and then on the odd occasion it’s water, spawn the splash and fire the splash sound. A wasteful approach. In the example above, all I do on the event is set a variable. That variable is checked in the character animation blueprint at the same place I check for footstep impact sounds, and the spawn actually happens in the Anim BP.

Thank you for the detailed response, and photographs! Yeah, I tried reading that document and following through it, but it’s a lot to take in all at once, and I still can’t get it to work successfully.

So, in your first photograph, is the target a custom variable called “Skeletal Mesh?” If so, what type is it, and how do you set it to ensure the proper anim blueprint is selected? I tried referencing the actual skeletal mesh BP from the level, but that node doesn’t look right in BP, and it doesn’t work properly when playing. Aside from that, my biggest source of frustration is my apparent inability to allow anim notifies to play in other BPs. If I can have a footprint anim notify trigger a splash in the level blueprint, then I can have a character walk through shallow water spawning particles when their feet touch the water. But at the moment, this is an inherent impossibility.

After we figure out setting anim BP references, I’ll make my attempt at water/physics volume overlaps in the level. At the moment, my anim BP is already insane, and all it’s really doing is spawning footprint decals, making sound, playing a particle effect, and changing some variables to dirty up the character material based on the surface type. Oh, and it’s also accounting for the speed of sound.

eb73f34603fbd80b5db4b54f5751ab050ba37a71.jpeg

Hi.

I cant really see the details as the resolution is too low, but off the bat ,consider liberal use of functions and/or macros to break up your blueprint. It’s a tangle of wires which can become unwieldy if not organised hierarchically. besides, you get extensibility and reusability too. And, if you find yourself casting for doing something more than once, consider wrapping it a function.

That skeletal mesh variable is simply a reference to the mesh component in the character blueprint. You literally grab the component out of the character BP component list, and drag and drop it onto your canvas.

From another blueprint, anywhere, you can get the same simply as: (sorry on mobile, no screenshots)

GetPlayerCharacter->cast to character blueprint->Get Mesh->Get Anim Instance->Cast to your animblueprint, then SET the result to a local variable of same type as animblueprint.

Does that make sense?

Alright, I managed to get footprints to sort of work the way I want them to. Once you enter a custom trigger volume, anim notifies will send the splash particles to play at the surface of the water (it actually takes the location of the foot socket and traces upward). Unfortunately, I can’t figure out a way to call an event when a skeletal mesh socket is dipped below a certain height without calling it every frame (IE, overlap mesh with trigger, then check socket for height every frame, and if below height of the water plane, fire off splash effects).

Now, I’d like to fire off an event from one Blueprint to another. I created a particle system that generates rings around the character while in water (floating at the surface), and I attached it to the character. I’d like an event in the level blueprint to turn this particle system on when entering the trigger, and turn it off when exiting. I can link variables no problem, but casting events seems to be another issue entirely.

I like this thread and have replied to it to be put on the notification list.