Water walker!!!

Hi there

As you see in the island demo you can walk underwater and you can’t swim.

Is there any way to fix it???

I know there is but how???

Write a piece of code that changes the movement system whenever you enter a trigger placed a couple feet under the water.

Anything beyond that, you’ll have to figure out yourself :stuck_out_tongue:

yeah, that’s trigger,
On exit, and on Enter trigger…

and in that case , gravity should be about 0, jump should be off, u should add up and down movement, and you should switch animation from walking to some thing you don’t have in island demo…

I thought about it.

But there should be a way to swim on the surface of the water.

If I put the trigger a couple of feet underwater the PLR can’t swim on the surface and if I put it at the same level then the PLR will swim in the first inch underwater and it’s not acceptable :!:

And Island demo was an example,I’m working on my project which includes a sea like that.

So instead of a horizontal trigger at the surface, try a vertical (capsular?) trigger set in a few feet from the edge of the water.

I tried it before!!!

Here is the problem:

there should be a very thin trigger to make the PLR stay on the surface of the water like a real human.

If I do this then there should be no upper level but for the lower level there is another trigger and there will be problem by mixing the programs because half of the player is in underwater trigger and other part of the body is in the surface trigger :roll:

It looks very easy but it’s not.
I’m working on it for 3 days and I tried many ways but none of them work correctly.

Sorry for bad Grammar(If there is problem with it)

I meant for a spherical or cylindrical trigger that runs along the edge of the water, just a few feet out, where the water becomes too deep to walk in. If your water is irregularly-shaped, you may need a mesh collider and a custom shape. The idea is that a ringing collider hits the player on the way in and the way out.

Forgive my hastily made drawing.

I think the answer is more easy than you expected.

OnTriggerEnter, you turn true a variable called… eh… isSwimming. When the character touchs the shore ground, isSwimming must change to false.
So you just need to check if isSwimming is true or false to make your character a swimmer :smile:!

Of course you have to put the trigger a couple of feet underwater

EDIT:-------------
It takes me too long write in englsh; cjcurrie alredy answer you.

Okay I’ll try

But there are some waves on my sea====>I’m working on it and it’s not complete yet but going up and down is ready and the problem is that.

My sea will be like this but it’s not ready now…

And the picture is not mine so if you see it somewhere else don’t be shock.