Adding the ability to glide

I have a character I would like to be able to glide when Jump is pressed and held down. I’m having difficulties figuring out how to go about implementing this. Anyone here got some ideas and examples for me to peek through? I have a glide or flying animation I would like to add to this as well. Any and all help is greatly appreciated.

I don’t really have any examples, but if you set your CharacterMovementComponent’s movement mode to ‘Flying’, the character will no longer be affected by gravity, so that’s a start. As far as your animation goes, you should be able to check ‘Is Flying’ from your player controller, or by just checking the character movement’s movement mode in your animation blueprint.

I would go with Jam’s (yeah im going to start shortening your name to Jam now :wink: ) method and set to flying mode and then create your own custom faked physics to show how he should be moving and the speed at which he falls, which essentially is the same way gravity works you are just lowering it from its -9.8 value to something more like -3. Unfortunately you can’t just tweak the gravity setting during runtime without a plugin. There is a plugin available that you can use to tweak gravity but i think it affects everything rather than just 1 actor, perhaps you can set it to certain actors.

Rocketman!

You may catch an idea or two from watching a couple of Jetpack tutorialson YouTube. :wink:

So far, here is what I have done. In the Animation Blueprint I’ve created the following Blendspace.

&stc=1

and in the Character Blueprint I added this to toggle the flying.

&stc=1

I’m still a beginner so implementing what Jamendxman3 suggested is a little beyond me. Can anyone number out the steps!

When you press the InputActionFly, you’ll want to set the Character Movement’s movement mode to flying. Now from your anim blueprint event graph you should be able to set an Is Flying variable to the value of the player controller’s Is Flying Boolean, though you may need to cast to your player using the pawn owner as the object to get the Is Flying variable.

Can you show me how to properly connect the InputActionFly so it changes the CharacterMovement component’s movement mode to flying? I tried with no success.

Just connect it to this node:
7122ca217e.jpg

Good stuff, I had to add few more nodes in the CharacterBP and now it’s working.

Hi! I’m working on implementing the glide ability to my game as well. Would you be so kind to share how you solved it? :):slight_smile: