- Home /
Question by
Timurov · Jan 21, 2013 at 12:26 PM ·
gameobjecttransformswitchlocalpositionlocalrotation
transform.localPosition problem.
I'm trying to transform several gameObjects, through assigning a vectors for localPosition and localRotation using switch statement, see below, but when I'm trying to assign a assigned vectors to a gameObjects in result I've blinking gameObjects in assigned vectors by switch statement, I don't know what I'm doing wrong, please help in this matter.
switch(mapto.mapTo)
{
case"x":
v.Set(UDPReceive.ReadSingleBigEndian(UDPReceive.data, mapto.indexToReadFrom),v.y, v.z);
break;
case"y":
v.Set(v.x, UDPReceive.ReadSingleBigEndian(UDPReceive.data, mapto.indexToReadFrom), v.z);
break;
case"z":
v.Set(v.x, v.y, UDPReceive.ReadSingleBigEndian(UDPReceive.data, mapto.indexToReadFrom));
break;
case"a":
r.Set(UDPReceive.ReadSingleBigEndian(UDPReceive.data, mapto.indexToReadFrom), r.y, r.z, r.w);
break;
case"b":
r.Set(r.x, UDPReceive.ReadSingleBigEndian(UDPReceive.data, mapto.indexToReadFrom), r.z, r.w);
break;
case"c":
r.Set(r.x, r.y, UDPReceive.ReadSingleBigEndian(UDPReceive.data, mapto.indexToReadFrom), r.w);
break;
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613091322im_/https://answers.unity.com/themes/thub/images/avi.jpg)