Rotate based on vector?

Hi,

So if were to rotate a actor based on a forward vector, how does one do that?

Example:

  1. if i am facing in the direction 45 of Y, how do i rotate a object “Forward” in the Y Axis
  2. so like the actor would rotate forwards based on where i am looking?

Thanks

What kind of actor is this?

  1. Pawn

  2. Character

  3. Blueprint of some sort

If you just want to go in the direction of the camera, then you can take the forward vector of the camera and use that to generate forward motion. But it really depends on the above, and how you are current creating motion.

Hi,

So its a Pawn. Would really appricate if you could make some sort of simple tutorial/type on how to do it

You’d rotate the right vector.

  • :red_circle: forward
  • :green_circle: right
  • :large_blue_circle: up

2 Likes

I seems like i may be doing something wrong…
I’ll try to explain it better sorry.

Lets say i have an object (scene reference) inside my pawn blueprint. I then place that pawn based on a raycast if i then want to rotate the object based on my cameras looking/forward position, how do i do that?

I am trying to make my camera pan around (without a spring arm)
Currently i have my object rotateing based on the Y Axis, but if my camera is looking in a different angel, the Y axis doesn’t seem to be a “Forward” now, the camera will rotate wierdly around

Like this maybe:

You can add an angle offset by combining rotators but there are other ways, too.

Other than that, keep clarifying until I get it! :smiley:

Hi,

So yes and no, but before i get into more details i think i may just use half of the day, trying to make it work myself. Perhaps i may learn a thing or two :slight_smile:

Besides that, i would love to thank you, i really appricate you taking your time and helping others, mutch love <3

Thanks

1 Like

I’ll take that for now :stuck_out_tongue: Consider attaching a sketch / drawing next time. Will save you a 1000 words.

Good idea, will make sure to do that next time :smiley: