Given some % chance to make a shot, how would you setup a Basketball game to shoot a ball and account for different types of makes/misses such as…
Rim bouncing
Backboard shots
Airballs
Nothing but Net
It seems like Physics would be most logical way to go about this, but you would need some sort of influence to force a make or miss. Like pushing the ball away from the center of the basket. Backboard simulation seems to be the hardest part. How on earth do you calculate some point on the backboard to shoot at from a given origin?
Again…I am not interested in “Shooter Game” mechanics where the physics system just takes the reigns. I want to give the System some % chance to make a shot, and then the result should be a random type of make/miss.
Do you own Skele from the Asset Store? It already has a ‘game of catch’ set up as an example you can mod. Look up physics equations for shooting / throwing a mass in the air and calculate the path based on the initial forces supplied by your player / AI. I’d be surprised if Unity hasn’t got at the ready a library of such physics equations as that’s what the PhysX is, however I haven’t worked much with the PhysX API.
I don’t see how you can do an RNG approach with physics. You would need to sample too many positions to find one that scores or misses…also calculating where the ball will bounce…after 2 or even 3 bounces before it hits anything.
example: Ball hits backboard, Ball hits front of rim, Ball bounces in the air, Ball hits another spot on the Rim, Ball bounces into basket…