Top-Down Aiming System

Hello!

I am working on a top-down shooter game and I’m having a difficulty creating the aiming system.
Here is what I’m trying to do:
The player moves the mouse cursor around and the character aims wherever the mouse cursor is (from -180 to 180).
img01.png
img02.png

And here is my setup:
Animation Blueprint:


1D Aim Offset:

Character Blueprint Event Graph: (The ‘Look Direction’ variable affects the 1D AimOffset)

With this set up, the front part of the character is working great but whenever I go lower than -90 or higher than 90, the value just returns to 0, instead of going all the way to -180 and 180.
img06.png

What I am doing wrong?

Thanks,
Dan Zaidan

Just figured it out.
All I needed to do was a Branch (if statement) to separate the rotation in two parts (one was already ready, the other one was just the same thing flipped the other way). :slight_smile:

Hello, i know you post this 3 years ago but if you are here, please can you post a screenshot ?

I have a solution too :smiley:
When you touch the screen the character aim the touch point
I make it in Animation Blueprint

hey mate is there any chance to post some code I’m really interested on how this works cheers.

1 Like

Hi, I would also like to know

Does anyone still need the information?
I’ve made it in a simple way

1 Like

hello, i need

Within your character create this function. At the Event Graph, connect the created function with the Event Tick.