We've all played Mario, right?
Well, you know how when you go into the water and you're able to swim by constantly pressing the jump button?
I'm looking for a way to do that.
So, I need to know how I can make the player go into a body of water and be able to comfortably swim by jumping over and over again.
If you don't know what I'm talking about, take this link to a video of Mario swimming!
Thanks in advance!
Something like this?
player is overlapping water
on jump pressed
How do I do that
Bump! I would really appreciate the help ^-^
Develop games in your browser. Powerful, performant & highly capable.
Swimming is not one of the actions provided, so you would have to make your own..
Create a swimming animation
Decide what you want the swimming to look like
make actions based on that..
For example you could switch to 8 direction behaviour when overlapping the water..
just add the animations and you are done..
But you'd probably want more control over the swimming part, which would consist of adding more canditions and attached actions..
You might want to try searching the forum for earlier examples..
Like I said up there ^ I want the player to be able to swim by only pressing the jump button. I even provided a link.
I already have the animations, it's not that I need help with. I need to know how to make it so that everytime you press the jump button, you go up a bit. Just like in the link I put in the original post.
So you'd have to create actions for "going up a bit"
I guess setting the platformer jump strength and maximum fall speed while overlapping would get you more than halfway there..
Instead of changing the jump strength you could also choose to use "platform set vector x" and "platform set vector Y"
Switching to a different movement behavior may be easier for you, or doing your own custom platformer controls instead of the Platformer behavior. The other option is to generate an invisible platform just below your player's feet when you press the jump key in water. That way you can continue to keep jumping as many times as you want. You probably also want to reduce gravity, acceleration, maximum speed, and jump strength while in water to give it the right feel.
Simple swim example
Works perfectly, thanks LittleStain!