I have created a global variable in my catcher script.
public static var xPosition:float;
public static var yPosition:float;
function OnTriggerEnter(theObject:Collider){
if(theObject.gameObject.name == “Main Char”){
var m:GameObject = GameObject.Find(“Main Char”);
m.transform.position.x = xPosition ;
m.transform.position.y = yPosition ;
}
i want to access this in the other scritp and add the x location in it.
i m doing it like this
function OnTriggerEnter(theObject:Collider) {
if(theObject.gameObject.name == “Main Char”){
gameObject.transform.position.x = catcher.xPosition;
gameObject.transform.position.y = catcher.yPosition;
}
}
basically i m trying to make it a checkpoint using a global variable…
this doesnot work .
thanks in advance