Hey Folks, I have produced a bullet from my player that fires in players direction, but curious as to how to produce a bullet to be fired in the directions of the mouse?
Any help would be appreciated…
Hey Folks, I have produced a bullet from my player that fires in players direction, but curious as to how to produce a bullet to be fired in the directions of the mouse?
Any help would be appreciated…
You can use the following to get the mouse position:
With this mouse position in world space you can then subtract the world space mouse location from the player location to get a vector pointing from the plyer position to that world-space mouse position. You can get the unit vector in this direction with this node: https://docs.unrealengine.com/latest/INT/BlueprintAPI/Math/Vector/GetDirectionVector/index.html
Then you can spawn your bullet, rotate it, and fire it relative to this vector.
Hope that helps.