2.5D SideScroller (Anim offset aiming)

Hey all,

I have been having an issue that i’m unsure how to solve over the past few days and its really halting my progress with the project.

https://puu.sh/zea38/9ab239f31e.jpg

I have this project and the character plays from this perspective, much like shadow complex. I am using an aim offset for the character to allow him to point at the mouse position (Which mostly falls within the background). The aimOffset itself works perfectly but the values been provided are incorrect. While the character is facing right which is 0 In world rotation the aimoffset works perfectly. However when I turn around to face the left the character is confused where to face. From what I know the rotation that is provided to the aimoffset is as follows : Rightside of screen is 0 to -90, Leftside of screen is -90 to -180, these values don’t fall between the 90 to -90 that the aimoffset use.

http://puu.sh/zeahY/b756f052a5.png

I hope that points out what is mainly wrong, what i’m aiming for is for the look at rotation from the character to the mouse position to be sent to the aimoffset so the character can point. If anybody can assist I would really appreciate it!
P.s The rot base component is just an arrow component I’m using to make sure its reading from the middle of the character mesh because the pivot is bottom of the mesh

Thank you all very much for your time.
Calcorso

Hi. It seems you have to try evaluate your rotation in the actor transform space instead of world. FindLookAtRotation doesn’t take into account actual rotation of your character and just evaluates MakeRotFromX(Target - Start). So, you can try this construction instead:

It will create a rotator relative to your player actor, that points to the hit point in the actor space. I haven’t subtract origin here just because in actor space it’s origin is always zero.

Thank you so much that indeed did fix the issue! And the way you explained the logic was really great and clear. I have learnt something new today and can continue with the project. Thank you very much!