I don’t know why this is being such a pain but I cannot seem to get it working correctly.
I am in a 2d project, I have my player object in the bottom left corner of the camera view. I am taking click input from the mouse to fire a projectile at the mouse position. The aiming works fine, the problem I am having is that the speed of the projectile object is changing based on the distance of the click from the start point.
I am taking the mouse input, running ScreenToWorldPoint on it, subtracting the result from the player’s transform.position (player.transform.position - Camera.main.ScreenToWorldPoint(inputPos)) and passing the normalized result to the projectile and letting it transform.translate(targetPos * projectileSpeed * Time.deltaTime)
It all works as I would expect EXCEPT for the difference in speed. If you click very close to the player’s position the projectile moves VERY slowly.
PLEASE!! What am I doing wrong? Or not doing that I need to be?
THANKS!