Hi, when gamer click on the terrain then I save it as Array, but I want to use this Array in other script, it shows the error as follow.
Missing Method Exception: Method not found: Unity Engine.BoxCollider.RayCast, Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher()
my code: (attach to terrain)
static var checkPointArray = new Array();
static var checkPointSequence = 0;
var checkPoint : Transform;
function Update(){
var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);
var hit : RaycastHit;
if (collider.Raycast (ray, hit, 200.0)) {
Debug.DrawLine (ray.origin, hit.point);
if(Input.GetButtonDown("Fire1")){
Instantiate ( checkPoint, hit.point , Quaternion.identity);
checkPointArray[checkPointSequence] = hit.point;
checkPointSequence ++;
}
}
}
*enemy's code( move to the coordinate) *
var arr = terrainPosition.checkPointArray[0];
or
var num = terrainPosition.num;
I try many times to get the array or the sequence, but the error occur..
I really appreciate your help..