I want the player can create the sphere when he press the right mouse and when I release, the player shoot. Here is my script:
var BulletBossSuper : GameObject;
function Update () { Shoot(); } function Shoot() { if (Input.GetMouseButtonDown (1))
{
var clone = Instantiate (BulletBossSuper, transform.position,
Quaternion.identity);
} if (Input.GetMouseButtonUp (1)) { clone.rigidbody.AddForce(transform.forward*1000); //Report at this line : "Object reference not set to an instance of an object" } }
How can I make this script work
Regards