Rigidbody newBall = Instantiate(ball, position, transform.rotation) as Rigidbody;
newBall.transform.localScale = new Vector(.5f,.5f,.5f)
Returns and null reference error.
Rigidbody newBall = Instantiate(ball, position, transform.rotation) as Rigidbody;
newBall.transform.localScale = new Vector(.5f,.5f,.5f)
Returns and null reference error.
I would assume that your “ball” prefab is not of type Rigidbody, so trying to cast newBall to Rigidbody results in null.