Switch between a CharacterMovement like mode and SpectatorPawn-like movement

I’m trying to have a setup that can switch between a character walking with collision to a mode that can fly around in all 3 dimensions and clip through walls.

I can achieve the clipping and movement on 2 dimensions using “Set Movement Mode” and “Set Collision Enabled” but when I look up at an angle and press forward I only move as if I’m walking on a plane. I’ve tried playing with Gravity scale and air control but so far I can’t get the character to move up and down.

Happy to drop into a c++ solution if needed

Maybe how you inputted the velocity, is what had to change. Because basically if you use the Flying mode it just make the actor to go as the velocity make it go. With no gravity calculation for gravity and floor calculation.(just use safemoveupdatedcomponent - see phys flying for further information. But the idea is just make the velocity to go as your desired forward vector, thus character camera forward vector.