So, was catching up with events on FaceBook and I spotted a post in a group that I am an admin for, asking if anyone knew how to script shooting a ball, as the code they had written was not working as they expected. So, being the kind of person that likes to help people out, I wrote this.
While the left mouse button is down, build up power for the shot. Once released, set the shoot flag.
If the shoot flag is set, calculate the velocity, create an instance of the ball and apply the velocity to it, and that’s about it…
If you want to get the whole unity scene, then you can download it off my server here.