Character Floating and Movement in the Air

AnubisWolfman

New member
Hello,

I am trying to make an ability that simulates a "Jet Pack", letting the character float in the air, as well as let him be moved by player's input in all axis while floating. However I can't seem to make the character float because he keeps falling to the ground. I also can't seem to gradually make him rise from the floor. The one thing I could manage to do was to bring it instantly to an upper position (and then he just falls again). I am kind of lost here.

Could you help me to know what would be the correct approach here ? Which method of the ability class should I be overriding in order to the movement code not be replaced by the code of the controller ? Should I also involve gravity settings of the character controller ? could you please give me a code example on how to move the character in a upward or downward direction in a context of an Ability without the character be falling automatically to the ground ?

Any help would be appreciated. Thank you in advance for your help.
 
Hi Delforce. Thank you for your answer.

Do you refer to the ability pack ? It's great and I also look forward to it but it's a bit different of what I am trying to achieve. Although it also lets the character "stand" in the air, I need a way to the character move gradually on air (like it is on a jet-pack), like the way it does on the ground but staying static in Y axis position without falling to the ground.

I must be missing something obvious, because this is a thing that is really very easy to do with the UCC disabled, doing it by rigid-body/or transform, but I think it would not make much sense doing it not using the UCC solution.
I think my main issue is to know (in the context of a class that extends an ability class) where is the correct override method to put the code in without it being overridden by the controller. And maybe to know what would be the correct approach, if I should use the gravity properties, other concurrent abilities like restrict.position, transform, and so on.

If it is not possible to provide an example perhaps would be possible tell me where the correct place in the API / Ability Class Methods to accomplish this.

Thank you again Delforce for your response.
 
Hey Anubis,

Ah yep I thought possibly you might have missed the ability pack, never mind I was hoping to help.

I really hope you find an answer to how have that jet pack sort of thing with the UCC, sounds pretty cool.

Once again sorry I couldn't help you hopefully someone can, good luck with it mate.

Cheers
Del
 
For flying you'll definitely first want to set the UseGravity property of the CharacterLocomotion component to prevent the character from using gravity.

From there you'll want to override UpdatePosition/UpdateRotation to actually move/rotate your character. This video gives some more details on the structure of those methods:

 
Top