Help dealing with gravity for a dive kick attack

Can anyone please help me out with an issue I’m having with a dive kick attack that I’ve been working on recently?

Basically, the dive kick attack is supposed to work similarly to one in the later Igavania-style Castlevania games or the Cat Suit’s dive attack from Super Mario 3D World where the player is launched at a downward diagonal angle like this:

epicnamebro-order-of-ecclesia

The problem though is that due to the effect of gravity, instead of the player being launched in a diagonal straight line the player’s dive kick instead has an awkward slope to it.

I tried to remedy the problem by adding this bit of code from the gliding ability with the hope I that could use it to clamp the player character’s gravity in a way that would allow for a straight line descent to the ground but I couldn’t get it to work as intended.

Hey @HungryMoogle!

You can set the gravity of the pawn! Use your character movement component! Bring it onto the evnet graph, drag off it and use “Set Gravity Enabled” and set it to false. Then turn it back on whenever is good to do so! Then whatever velocity you set won’t be adjusted by gravity.

Hope that helps! :slight_smile:

1 Like

You might also be able to set movement mode to flying, set the CMC’s velocity to zero, and launch the character/add velocity in the desired direction.

1 Like