- Home /
Check position of another object with a certain variable value
I want to check the position of multiple objects with the same scripts and variables, but every object's variable has a different value (from 1 to 10) and i want to check the position of the object with a certain number ( so if the number is 1 i want to know the position of that object)
Here's what i got so far:
var itemTracker; itemTracker = GameObject.FindWithTag("GameController").GetComponent(GameStats);
var checkpointTracker; checkpointTracker = GameObject.FindWithTag("Respawn").GetComponent(checkPoint);
var Player : Transform ;
var reloadToLevel = 0;
function Update () { if(itemTracker.playerLife < 1) { if(itemTracker.currentCheckpoint == 1) { //Load checkpoint with variable number = 1 } }
}
Your answer
Follow this Question
Related Questions
Check if cube is in position before placing new cube 0 Answers
Camera rotation around player while following. 6 Answers
Compare Position of two gameobjects and if true, do nothing, help me please! 1 Answer
making position checker - is area empty or not (with trigger)? 2 Answers
Check GameObject postion 1 Answer