I am currently working on a top down pixel art game and I’m trying to get the projectiles I am using to aim at the mouse position. All the tutorials I’ve found are pretty old and suggest using the ‘get hit result under cursor channel’ blueprint which I can’t find it.
I am posting the code I’ve been using. The mouse definitely has some impact on the rotation however, its incredibly inaccurate. If you’re wondering why I’m adding/subtracting or multiplying/dividing random things its because I’m trying to center everything and make the positions use the same scale. I’m assuming my code is completely wrong but I don’t know what else to do.
This would give you the location of the cursor projected into the world above the ground - at the player’s waist, lets say. Now, depending on how the projectiles are supposed to work, you may need either direction or magnitude:
Ensure the projectiles do not collide with the player (collision settings of the root component / static mesh in the projectile actor). We don’t want to shoot ourselves in the foot.
Thanks for your reply. I feel like a total dumbass right now because I didn’t realize you just had to drag off the node from get player controller to find the blueprint. This was extremely helpful though thanks so much!
hi
is there a way that my cursor stays in a limited radius around the character? i want it to be fixed, so it doesnt move much away than that limited radius, somewhat in a way that " The Ascent’’ crosshair is
is there any advice to make this work replicated? I’m writting server logic in controller which is controlling a pawn that tells a server character where to be and so the get player controller isnt working for me