i had a problem with a script, but i fixed it and here is an another problem about that a same script which i have fixed erlyier. so im trying to say that in scripts everything is allright, i chacked it many times and but every time when im trying to enter a play mode i get this message: “The referenced script on this Behaviour is missing!” please help me if you can. here is my script picture :
using UnityEngine;
using System.Collections;
public class ball : MonoBehaviour {
public float ballVelocity = 3000;
Rigidbody rb;
bool isPlay;
int randInt;
void Awake ()
{
rb = gameObject.GetComponent<Rigidbody>();
randInt = Random.Range (1,3);
}
void Update ()
{
if(Input.GetMouseButton(0) == true && isPlay == false)
{
transform.parent = null;
isPlay = true;
rb.isKinematic = false;
if(randInt == 1)
{
rb.AddForce(new Vector3(ballVelocity,ballVelocity,0));
}
if(randInt == 2)
{
rb.AddForce(new Vector3(-ballVelocity,-ballVelocity,0));
}
}
}
}