I want my character to fly in a specific way

so i want my character to fly and this is what i have so far this makes him jump and takes him in and out of flying mode which is a good start but i want him to fly in the direction of the camera if i hold W and i want him to be able to go up with space and down with shift if he is in the air can someone please help?

The movement part is actually pretty simple. For the forward movement you just need the input event, a add movement input node, and then to control the direction use get actor rotation and get forward vector. For an example look at the thirdperson character template. For the up and down movement you do basically the same thing except you use the get up vector for the direction.

I made this same setup for a project earlier. Im not on my pc now but ill try to post pictures in the am. Like o said though is pretty much just like in the thirdperson template.

Edit: added pictures and fixed spelling.

Simplest version is get the pawn’s camera, get Forward Vector of that, multiply the forward vector by the number of unreal units you want to move forward per tick and then SetActorLocation to current location plus that vector you just calculated.

For space bar rising straight up motion, then you can map an input axis of positive 1.0 to the space bar, make an input axis event for that, multiply the input axis value by the number of unreal units you want to go straight up per tick, plug that into the Z of a makeVector node then setActorLocation to the current location plus that vector you made.

Forgot to mention this is the third person blueprint but thanks!

for the forward and backward movement i am using a keyboard so should i use W for the Y axis and S for the X axis?

no that wouldnt make any sense, if you had w on one axis and s on a different then that would be like having w move forward and s move right. what you should do is to make a input axis event in the project settings ->engine->input. make an axis input event and have w as a value of 1 and s have a value of -1 (if your in the third person example this should already exist). you can do the same thing for your altitude adjustment for flying too.

it has also just occurred to me that when you mentioned axis you may have been referring to my second picture above, in the picture the thumbstick x axis event is for strafing left and right (direction based on right vector). the y axis event was the one for forward and backward movement. the event with the comment turn on it is for turning / rotating the character.