Hi
When my player collide the trigger, i would like to move another object to another position. i have searched the forum, youtube an try using google to find out how to do. I have put a lot of time trying to learn how to do and it disturbs me not finding any working solution sense this seems like a kind of easy thing to script. This it what i got so far
function OnTriggerEnter (colid : Collider) {
if (colid.gameObject.tag == "Player")
transform.position (gameObject.tag("Point")) = Vector3(0, 5, 0);
}
maybe you want to declare the gameobject who will need to be translated as a private var?..
private var pointObject : GameObject;
function Awake () {
pointObject = GameObject.Find("Point");
}
function OnTriggerEnter (colid : Collider){
if (colid.gameObject.tag == "Player"){
pointObject.transform.position = Vector3(0, 5, 0);
}
}
Or you can do it this way:
function OnTriggerEnter (colid : Collider) {
if (colid.gameObject.tag == "Player")
gameObject.Find("Point").transform.position = Vector3(0, 5, 0);
}
Thank you a lot for this help, it became useful 