How do i make the player stop on collision with water?

I was making a water-body-ocean but my character was falling in or walking on the water. How do i make the player stop on collision with water?

You can place invisible walls.

Add planes that are set to HIDDEN at the edge of water.

But a was trying to not make invisible walls. I just wanted to know i it is possible to make the water solid in the Y direction

But what you want is literally an invisible wall.

You need to be careful with that (Z Direction, you mean) because if the plane passes under a landscape, then its collision will cut through the landscape.

You could program the character to stop movement toward the plane if they are “x” centimeters away, but that sounds needlessly complicated, and if the water passes under a solid surface, your character will bug out.

You could also create a water blueprint that is encapsulated with an invisible cube, which brings us back to square one.

If AAA developers can use invisible walls, everyone else can.

Keep it simple.

The Y direction is the east/west direction in the Unreal engine. The Z direction is the up direction.
Are you saying you want players to “walk on water?”
If so, make an invisible plane (or volume) that aligns with the water volume, and make that be “block all dynamic” or similar walkable collision setting.

How do i make the player stop on collision with water?

This sounds like you want the player to stop walking towards the water, when they get to the water – e g, they cannot keep walking out across the ocean. To do that, use an invisible wall.
However, my guess is you want the player to just stop moving downwards (Z direction) which means making the water volume a collider, or placing a separate invisible collider in a plane with the water – I’d recommend the second, I’ve never tried the first.

But when i click on the water in my editor i see a orange line where the water collides with the landscape. Is it possible to do it is solid all up in the Z direction

The yellow line is non-discriminatory.

I’ve bounced this through my head, but no matter what, if your water’s collision is in more than two dimensions, you’re going to have to deal with when the water passes under a landscape.

You can suggest for Epic to add a feature that does what you want, if a plugin for it doesn’t exist already, but you need to keep in mind that though it may sound simple, what you want is actually very prone to error and likely is performance-heavy.

The better you get at programming, the more you’ll understand why things need to be as simple as possible.

Hello, Try to set the Z velocity of Character movement to something like -1000 when the character begin overlap water. this should stop the falling movement and simulate a water pressure

I have an environment with a Lake (plane surface that cuts through the landscape).

I added a collision to the lake / plane and then created a Phys Material and assigned it to the Lake.

Then I used the Character footstep code (the code that detects if I step on water or land based on their Phys Material to play a specific footstep sound). And along with the sound cue that plays according to what surface the player steps on, if I detect a Lake Phys Material, I set the Max Walk Speed to 0.

When the player reaches the edge of that lake surface (plane), it stops .

Now to get back to the land it might seem stuck for a couple of seconds as it takes a few steps to unlock its speed and get it back to the normal land walk speed. Perhaps this happens because my water plane cuts into the landscape…

I also tried Stop Movement for the character, however it gets in the water but becomes very sluggish as if it is floating…