Firing towards mouse
Hello everyone, I've been trying to make a shooter for my platformer game. I've tried bunch of techniques, none of them worked as I desire.
I want my platformer actor to be able to fire towards where mouse is pointing, so I want to get the angle between its position and the mouse position. As my character is a ball moving around with AddForce (so its rotating while it moves) I wanted to store rotation and location where the projectile will be created from.
This was the closest approach I've found:
The angle wasn't calculated correctly when I moved the mouse left side of the actor. It sets the firePos' Z rotation to -180 when the mouse is on its left, however, what I want to achieve is a 360 degree rotation (from 0 to 360), just like a topdown character, and not in between 90 and -90. I later removed the Z axis.
How can I make this work?
Any help will be appreciated
Thanks in advance.
asked Jun 16 '18 at 08:51 PM in Blueprint Scripting
Follow this question
Once you sign in you will be able to subscribe for any updates here