Glider Pitch and Roll

Trying to get the player to pitch down (when in glider mode) and gain speed. Possibly even gradually lose speed when pitching up. Trying to get it to work with mouse as well (or keyboard if needed for controll).
Issues im having:
Cant get pitch up/down to work.
Player Loses speed when not holding W.
Cant figure out how to clamp the rotation when rolling (and pitching probably).

Here’s a video of the glider in action.

Any help would be greatly appreciated.

Get the world rotation of the glider. Get the forward vector from the rotation. Depending on the Z value of the forward vector increase/decrease the speed. You want to do have some friction that increases with speed so it feels more realistic and prevents further accelleration at some point.

Get the right vector of the rotation and use its Z value for clamping left/right rotation. You should not work with Roll part of rotation as it could cause issues with gimbal lock.

not working so far, probably have it set up wrong.
glider is attached to the player character, not sure if it helps at all. Just setting its visibility.

Also Tried This the input axis is mouse Y

Z of the Forward vector. When flying straight, it will be 0. When pulling up: 0]…1], pulling down: [-1…[0

GetWorldRotation->GetForwardVector->Z

And you should use that value to calculate the accelleration/speed, NOT plug it into MovementInput.

You can multiply the speed with the ForwardVector of the Rotation and Plug it into MovementInput.

1 Like