How to fix angular offset with "look at cursor" function in the top down template

Hi there,
i am trying to make a top down shooter.

i did change the controls so that my character always looks at the cursor.

For some reason, i do get kind of an offset when i am shooting diagonally.

Here you can see the offset (while aiming at the zombie):

247505-right-diagonal.png

When i am shooting up or down, there is no offset.

Hope you can help me with this, thanks !

Are your enemies set to be collided with in the correct channel? If not what could be happening is the line trace is passing through them and hitting the ground behind making the direction of the hit a bit higher in the Y axis than it should be, essentially forcing you to aim at an enemy’s feet to hit it. Check to see if this is what is happening.

You may need to add special colliders to your enemies whose only purpose is to be hit by the line trace. You may want to do this by using your own custom collision channel to isolate the functionality from other collisions or traces.

Are your enemies set to be collided with in the correct channel? If not what could be happening is the line trace is passing through them and hitting the ground behind making the direction of the hit a bit higher in the Y axis than it should be, essentially forcing you to aim at an enemy’s feet to hit it. Check to see if this is what is happening.

You may need to add special colliders to your enemies whose only purpose is to be hit by the line trace. You may want to do this by using your own custom collision channel to isolate the functionality from other collisions or traces.

You were right, i had to edit the collision channel. Thanks for your help and sorry for my initial answer :slight_smile:

Wait, that was not solved right? The offset still happens expecially when there are no enemies to block the cursor tracing. The camera ‘tilt’ causes this ‘‘offset’’ (the cursor trace appears to be higher then the mouse in X)
Try to offset the Actor Location In X before connecting to the find look at. This will make up for the camera ‘tilt’. You can try to offset the trace from the cursor to match the camera tilt as well, but it is easier to add or subtract from the character.
I had this issue recently and found no solution researching. Hope this helps someone.