Home   Help Search Login Register  

Author Topic: solved : geting relative position  (Read 1565 times)

0 Members and 1 Guest are viewing this topic.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
solved : geting relative position
« on: 31 Aug 2007, 22:25:56 »
im creating a script dat will randomize da position of a camp... now i placed da whole camp so it looks good in 1 place... is dere a way 2 get da proportions between da objects ? (so i can use it w/ modeltoworld comand 2 make it stay da same everywere)

it doesnt matter i figured it out....

worldtomodel is the comand i needed

here is my script if ny1 needs somin similar

Code: [Select]
private ["_unit","_obj","_relpos","_pos"];

_unit = _this select 0;
_obj = (getpos _unit) nearestobject (_this select 1);
_relpos = _obj worldtomodel (getpos _unit);
_pos = getpos _obj;

waituntil {(_pos select 0) != ((getpos _obj) select 0)};

_unit setpos (_obj modeltoworld _relpos);

if (true) exitwith{};

LCD OUT
« Last Edit: 31 Aug 2007, 23:41:56 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta