Okay so basically, a game is being created in C++ in unreal. The game is 2D and the character should be able to fire projectiles. Basically, i’m fairly new to unreal and require a push in the right direction to getting this implemented.
I want to be able to do two different things:
-
How would I limit the the mouse cursor to only be allowed on the red line, such that if you move the mouse upwards it will go to one end of the red line, or down and it will go down another?
-
How would I calculate the angle between the character and the mouse position, to calculate the angle to fire the projectile off in?
I’m not asking for a full solution, i’m just wanting a push in the right direction?
Any help would be greatly appreciated! (Sorry about the bad paint drawing, haha)