Hi everyone !
So as the title says, I want to create a 2D aim system for my 2.5D game but I can’t seem to find any reliable tutorial out there. After hours of failed attempts I’m finally coming here to ask for your help.
I want to shoot at the mouse position when I trigger the shooting event, only using X and Z axis.
Everything in stored in the player character blueprint, there is nothing in the Player Controller. The camera is on the side and follows the player as it moves.
There is one tutorial (link below) that gets exactly where I want to go. But there’s no way to reproduce it right since there are subtle cuts in the video and no explanation.
I’ve tried to do some tweaks but the line trace is always fired from the camera or the character but in the wrong direction.
If you want to have a quick look at the said tutorial, here’s the link : https://youtu.be/_qRBNEbwFoE?si=bYlD0PaSzX9_Dx4r
But, I still managed to get something from that tutorial and here’s how my code looks as of now (with some tweaks in ordrer to try to make it work)
The “Get Mouse Position” event is fired when the player use the right mouse button input, it sets the following boolean to true and allows for the event tick to flow in the nodes of the screenshot.
Now for what’s inside the “Aim Location” function, please note that this is not my code, it’s a (hopefully) recreation of what is shown in the tutorial :
I don’t know if it will be of any help but now you have all the information that I can bring to you about my problem.
So, am I headed in the right direction ? Is there a simplier and easier way to achieve what I want ? How would you do it ?
Thank you for the time you will bring upon my request, feel free to ask for more details about my code if needed.