Download

Rotating pawn with camera pitch/yaw/roll movement?

After having attempted to get this working for a while now I’m really stuck. Updating original question to something shorter:

Does anyone know how to locally rotate the player (collision volume + camera) relative to pitch/roll/yaw movement output?

Attached link to video to describe the problem! :o

https://app.box.com/s/zu5x6anjgv2jdwp1iz53

6 hours later.

Bumping just this once - simplified the question so that people don’t have to read a giant wall of text. I’ve been trying a lot of stuff and I’m pretty stumped at this point.

When your getting the Forward, Right and Up vectors you should be getting that of the camera instead of the player actor itself. That way you’ll all ways move based on where the camera is facing. Hope this helps.

You’re right that would make it much easier. However, I was not able to figure out where to fetch the camera actor from. Plus, what I want to do is to actually rotate the actor along with the camera… here is my setup:

i am on my tablet, so I keep this short.

The key is to apply rotation around your root axis. If you have cam attached to that root, it will rotate with it.

i see that you use AddControlInput, but think those functions dont really do that. I might be wrong on this, but I think that those functions always assume that your character is Z-up.

To fix that, you’d have to replace them with your own ones, that always rotate around the current Forward-, Up- and RightVector.

*edit: A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums

This might help you

Hey, thanks for the reply.

I tried doing this by reworking the flying pawn blueprint yesterday. The movement is correct, however the new problem becomes that my pawn completely stops in world space whenever I release my inputs (W, A, S, D). I would like it to maintain some velocity and slowly slow down to a stop. Maybe I should start a new thread for that? Unless you know a good solution to this. :slight_smile: Thanks!

Here is a video from the first Crysis game showing what I want to do:

If the video doesn’t take you to the right place it’s 40 seconds in.

You can hear that he’s pressing the W key to go forward (there is a faint gas audio sound when it is pressed) and the speed is dampened as he releases the input.
I guess I will need to set up an acceleration logic for this.

Otherwise this thread is solved. Thanks for the help guys :).

Not sure if you are still looking into this but if you use this guide for the forward backward motion and use yours for the rotation should work.