I have script attached to a prefab that is set to run some pretty basic functions when Instantiated. When it reaches Update I receive MissingComponentException. This is because the RigidBody Component seems to have been removed when it reaches the Update function. I have verified this in my debug screen. The prefab has the RigidBody attached but the clone does not. Any ideas?
void Start () {
missileClone=GameObject.Find("GameBoard");
GameInput=missileClone.GetComponent<GameBoard>();
if(GameInput!=null){
this.renderer.enabled=true;
this.transform.position=GameInput.GetTouch();
}
}
// Update is called once per frame
void Update () {
this.rigidbody.velocity=transform.TransformDirection(Vector3.forward *10);
}