How do I throw an entity when the player holding it presses the left mouse button (LMB)?
Okay, so I'm trying to make a smalle ball game, and therefore it is essential that the players can pick up a ball and toss it around. So far I've got the pick-up mechanic working, but from there I need to allow the player to throw the ball. I've chosen a cannonball and pimped it a bit, made it unique so I can add a script to it.
Currently I'm trying to get the script to do the following:
When the cannonball is in the players hotbar AND is selected AND the player presses the LMB ->
Throw/shoot cannonball in the direction the player currently aims
I can't find a way to run a script when the player has the cannonball selected and presses the LMB, so how do I do that?