Download

How to add the player Aim direction to an Actor rotation (Math question? :) )

Hello,

I’m having some issues while trying to apply the player rotation to an object that’s being rotated by an Arcball.

So, here’s the image for the rotation part.

In both “ticks” of rotation, I’m moving my mouse upward.
So, the rotation doesn’t follow the player in there.
As long as the camera angles doesn’t change, it seems to be working perfectly.

So, I thought that, to fix this, I should just get my object quaternion, multiply by my player view quaternion ( [FONT=Courier New]GetControlRotation().Quaternion() ) and everything would be perfect, right ?

I got really happy with my initial results… as soon as I turned my object horizontally, this happened

I’m doing experiments for many hours now, but I’m not sure what’s wrong in there :frowning:

Can someone give me some help in this matter? My head hurts really bad right now ><

Thank you in advance :slight_smile:

Have you tried using GetControlRotation from your player controller?

That’s exactly what I tried in the 2nd image. Thank you for you input anyway :smiley:

I solved the issue by using Atan2 on the Pitch for GetControlRotation() :slight_smile: