I’ve got a player I’m working on that needs the ability to fly. I know that the player movement component has a flight mode, but when I go into that mode it disables gravity. I need gravity for the flight since I want it to be more like flying like a bird or in Sky (Children of the Light).
I’m currently trying a custom movement mode but it has a few issues. The code is as follows:
The issues are that if I bump into a cliff or the edge of an object, my player just kind of gets stuck there. I was thinking of replacing this with a square collision check, but then I’d also need to get the normal of the ground to check if it’s a wall or the ground on a lean, etc…
So I have two questions:
- If there is a way to fix up the above so that I can safely detect landing, how would I do it? The other half of the problem I have about this is that in the modes “Flight” and “Dive”, my whole player will be rotated around to face the direction they’re moving, so is there also a way for me to account for this when I do them?
- If the above is either too complex or too difficult, or there is a much easier way to do this, what should I do?
I’m not really in a rush for this, I do have a few months before I actually need this, but I’d like to get it sorted as soon as possible. Any help is appreciated!
Edit: I did manage to get landing safely working using this
Could probably get the actor hit & switch based on type to enable swim if needed or whatever?
That aside, I’d still like to know if I’m just overcomplicating this and there’s a better way to do it…


