Question by
ociustemp · Dec 21, 2015 at 04:36 AM ·
positionpositioninglocalposition
i want to find object x position value at run time please help me
i want to find object x position value at run time please help me
/ update() { runtime calculated position for 1 or 2 object1x=800 // need to find this value from any function object2x=1200 * For number 12
if(number="12" && object2x>object1x) {
if (o12d < twoobjdistance) {
s12.SetActive (true);
if(ic12==false)
{
o1.transform.localPosition=new Vector3(o1.transform.localPosition.x+plushx,o1.transform.localPosition.y,o1.transform.localPosition.z);
o2.transform.localPosition=new Vector3(o2.transform.localPosition.x-subx,o2.transform.localPosition.y,o2.transform.localPosition.z);
ic12=true;
}
}
else
{
if(ic12==true)
{
o1.transform.localPosition=new Vector3(0f,o1.transform.localPosition.y,o1.transform.localPosition.z);
o2.transform.localPosition=new Vector3(0f,o0.transform.localPosition.y,o0.transform.localPosition.z);
ic12=false;
}
s12.SetActive (false);
}
}
//For number 21
if(number="21" && object1x>object2x) {
if (o12d < twoobjdistance) {
s12.SetActive (true);
if(ic12==false)
{
o1.transform.localPosition=new Vector3(o1.transform.localPosition.x+plushx,o1.transform.localPosition.y,o1.transform.localPosition.z);
o2.transform.localPosition=new Vector3(o2.transform.localPosition.x-subx,o2.transform.localPosition.y,o2.transform.localPosition.z);
ic12=true;
}
}
else
{
if(ic12==true)
{
o1.transform.localPosition=new Vector3(0f,o1.transform.localPosition.y,o1.transform.localPosition.z);
o2.transform.localPosition=new Vector3(0f,o0.transform.localPosition.y,o0.transform.localPosition.z);
ic12=false;
}
s12.SetActive (false);
}
} }
Comment
does your code work or are there any compiler errors? if not, what happens if you start playing?
Your answer
Follow this Question
Related Questions
Can you help explain this positioning conundrum to me! 1 Answer
iscometric grid panning 0 Answers
Changing the placement of circular motion in 2D? 1 Answer
localPosition not where expected 1 Answer
snap object to gridwise 0 Answers