- Home /
Question by
aqeel25 · Apr 13, 2019 at 03:52 AM ·
transformtransform.translate
Move two objects at same time as they are one single object
I have two different objects in my scene.I want to move both of them up or down as they are one object.But their positions are not same .And i am doing as following code.
ZDirection = Y- ivalue / 10; //head
ZDirection1 = Y1 - ivalue / 10; //arm
for (; Y > ZDirection; Y--) //head
{
await Task.Delay(1); // Delay of 1 Milliseconds
head.transform.Translate(new Vector3(0,0 , Y));
}
for (; Y1 > ZDirection1; Y1--) //arm
{
await Task.Delay(1);// Delay of 1 Milliseconds
arm.transform.Translate(new Vector3(0, 0, Y1)); ;
}
Comment
Your answer
Follow this Question
Related Questions
transform.Translate not working after exporting to Android 2 Answers
How do I get the collider working when I do transform. 1 Answer
Moving an object by few units up and stopping it , but so like it looks like an animation . 3 Answers
Why is rotation offset 1 Answer
Alternative to using transform.translate and transform.position for moving objects exact values? 1 Answer