Download

How to align world direction (in add movement input) with rotating camera

Hi, Here is the situation.

  • I have a camera which is not bound to any character (it is a camera setup for dual fight like UFC).
  • The camera rotates with the movement of the characters to keep the 2 characters constantly at two side of the screen, just like a usual dual fight.
  • The world direction is in “add movement input” node in character blueprint
  • And I have used level blueprint to locate and rotate the camera between the fighters.

So, when the camera rotates, I need to align/match the world direction with the camera rotation. Otherwise the movement goes crazy. Any suggestion Please?

Get camera actor’s rotation using get Actor rotation then use get forward vector on that rotation. feed the resulting forward vector to your ad movement input if you want to move in the direction camera is facing.

There are also get right vector to get right side of an actor’s rotation

Thank you Commander. This is actually what I need. Thanks for your reply