Need help with Aiming

Hi,

I need to determine X,Y value, direction where the player is aiming in relative space to the player character. So if the player character is facing X direction in WS and aims there, then X = 1 and Y = 0, when the character faces Y direction in WS and aims there, then X = 1 and Y = 0, same values, because the player is still aiming and facing forward, not to the left or right.

Now I dont really know how to do it.

I have a vector that points towards the target (x), but it is in WS:


Cna anyone give me a hint please?

hi,
you can use GetForwardVector


hope this helps you :slight_smile:

cheers :vulcan_salute:

You didnt understand what my problem is.

I need to determine where my character is aiming when standing still relative to the character. So if the player is aiming forward, then x should be 1 and y should be 0. If player is aiming abit to the right, then x should be 0,5 and y should be 0,5. If to the right, then x = -0,5 and y = -0,5.

image
image

hi,
sorry was busy the last days…
how about that, it will only track the gun in respect to the player


this is just a dot operation

hope this is the thing you are looking for :slight_smile:

p.s. the dot goes from -1 - 1 but you can clamp it to your needs

cheers

Thank you, this looks promising. Never learned dot produkt gonna take a look at it a bit later.

1 Like