05.04.2010, 14:50
put one of the objects in the new place you want (do not save it!), get the new object position, compare with the old position... lets say:
Old X was: 305.23
New X is: 1640.61
Old Y was: 109.15
New y is: 1002.80
X: 1640.61 - 305.23 = 1335.38.
Y: 1002.80 - 109.15 = 893.65.
Then you can do like this:
Do with All objects: Coords + dif from new pos.
Warning:
This is a example code. You have to do your own code for this to work.
Ps: works great when I need to move many objects.
Old X was: 305.23
New X is: 1640.61
Old Y was: 109.15
New y is: 1002.80
X: 1640.61 - 305.23 = 1335.38.
Y: 1002.80 - 109.15 = 893.65.
Then you can do like this:
pawn Код:
// old:
CreateObject(model,305.23,y,z,rx,ry,rz);
// new:
CreateObject(model,x+1335.38,y+893.65,z,rx,ry,rz); // obj 1
CreateObject(model,x+1335.38,y+893.65,z,rx,ry,rz); // obj 2
CreateObject(model,x+1335.38,y+893.65,z,rx,ry,rz); // obj 3
Warning:
This is a example code. You have to do your own code for this to work.
Ps: works great when I need to move many objects.