Spawn in debug console globally (Stratis) if connected as the client, adapt _locality if you wanna use you HC instead of the player
[] spawn {
STARTPOS = [1772.49,5706.24,0.00143862];
ENDPOS = [1779.07,5680.48,0.00143862];
TIMER = time;
OBJECT = nil;
LOCALITY = nil;
READY = nil;
player setpos STARTPOS;
sleep 5; titleText ["Creating unit on server and setting ownership to player unit!","PLAIN"];
if (isServer) then {
_unit = (createGroup CIVILIAN) createUnit ["C_man_1_1_F", STARTPOS, [], 0, "NONE"];
_locality = owner (([] call BIS_fnc_ListPlayers) select 0);
waituntil {local _unit};
[_unit,_locality] spawn {(_this select 0) setowner (_this select 1)};
waituntil {!local _unit};
LOCALITY = _locality;
OBJECT = _unit;
publicvariable "LOCALITY";
publicvariable "OBJECT";
};
sleep 2; titleText ["Waiting for unit to be ready!","PLAIN"];
waituntil {!isnil "OBJECT" && {!isnil "LOCALITY"}};
sleep 2; titleText ["Trying to move unit where unit is local!","PLAIN"];
if (local OBJECT) then {
OBJECT doMove ENDPOS;
diag_log format["doMove called for %1 on locality %2 where unit is local %3",OBJECT,LOCALITY,local OBJECT];
waituntil {unitReady OBJECT};
READY = true; publicvariable "READY";
};
sleep 2; titleText ["Waiting for unitReady!","PLAIN"];
waituntil {!isnil "READY"};
if (OBJECT distance ENDPOS > 2) then {
titleText ["Unit did not move to endpos!","PLAIN"];
} else {
titleText ["Unit did move to endpos successfully!","PLAIN"];
};
sleep 2; titleText ["Ending test for setowner!","PLAIN"];
};