Top Down WASD Mouse Shoot

Hey everybody, I have been working on a Top Down WASD game, and got stuck on a problem for a quite a while, and it seems I can’t get past it, the reasons might be that I am a beginner with BP’s, scripting and such.

The problem I am having is that I can’t seem to get the “mouse shoot” to shoot in the right direction.

So far what I’ve done and what I can understand is that whenever the LMB is pressed, it spawns the projectile from where the character is standing. But I can’t seem to find a way to get it to shoot in the direction.
I need to get it to shoot in the direction of the mouse cursor.

Also I’ve been wondering that, is this to be done more easily in C++?

Help is appreciated, thanks.

This is very easy to do in blueprints. All you have to do is get the vector from the character to the mouse and then normalize it. This normalized vector can be used to fire your bullets.

To get the location of the mouse, use the node ConvertMouseLocationtoWorldSpace or GetHitResultUnderMouseByChannel. Now just multiply the bullet speed with the direction vector above and plug everything into the system you have for shooting.

One solution.