Download

Moving player in direction of rotation

Im trying to make the character move in Z axis every tick and have me rotate it in the X axis. Already tried out a few things. Currently I managed to make my character rotate properly when I press A or D (im only rotating in the X axis) but the direction never updates, it only moves up and not to the sides.

Essentially, a rocket going to space.

Any suggestions? Been stuck on this for a day now…

If you are trying to make it using a classic shmup side camera, you can get the actor rotation and the Up vector for the direction, I believe. How are you actually getting the direction vector?

I think I can help you better if you post some images.

Okay I’m assuming your rocket is going straight up and your camera is side view. Your rocket currently goes up , and movement works it’s just that the rocket facing direction does not follow the direction?

If that’s the case try this solution :
( provided if you’re using CharMovementComponent and that you’re using controller to manipulate the pawn )
In the characters’ settings ( not sure if it’s movement component or the char itself ), there is 3 checkbox that says "Use Controller Yaw/Pitch/Roll . I believe by default ,2 of it is checked. If your rotation is actually ‘rolling’ the char , you might need to check the roll and uncheck the other.

Another way is to Pawn and add a ProjectileMovementComponent . Set starting velocity , and check the “rotation follows velocity” , then move away. it should now face the direction it is moving.

The camera is below the rocket, so its actually looking up to the sky.

The idea is as if you’re below the rocket,like the first image Im posting.http://imgur.com/q8ZQ58H

So far, im detecting if the key pressed is either A or D. If its A, it subtracts 1 do add world rotation to my camera(I made a separate one from the character) and adds 1 if its D. Ive been trying everything, but I can only make the camera to rotate, but not to move it in Y depending on the rotation (e.g. The camera Rotates left, and as its constantly going up in Z, it goes in Z but also in Y depending on the current rotation). Hope its easy to understand.

do you need your character to roll ? is that correct?
Maybe you should check the checkbox that follows controller roll. Provided your controller is actually doing roll direction. I’m not sure how ur movement was setup

The idea is as if you’re below the rocket,like the first image Im posting.http://imgur.com/q8ZQ58H

So far, im detecting if the key pressed is either A or D. If its A, it subtracts 1 do add world rotation to my camera(I made a separate one from the character) and adds 1 if its D. Ive been trying everything, but I can only make the camera to rotate, but not to move it in Y depending on the rotation (e.g. The camera Rotates left, and as its constantly going up in Z, it goes in Z but also in Y depending on the current rotation). Hope its easy to understand.

Yes, I need the character to roll. Hope I managed to explain it.