Jump to content

Sign in to follow this  
dreadedentity

setDir not working?

Recommended Posts

Hey all,

I have some code that looks (exactly) like this:

_base = [];
_center = createVehicle ['Sign_Arrow_Blue_F', [14641.7,16179.2,0.00144577], [], 0, 'CAN_COLLIDE']; //this area is on Altis main airfield (runway) I suggest you bring a car to help you find it easier.
_bPoint = getPos _center;
_base pushBack _center;
_obj = createVehicle ['Land_CampingTable_F', [(_bPoint select 0) + 1.73438, (_bPoint select 1) + -1.90039, (_bPoint select 2) + -0.00128746], [], 0, 'CAN_COLLIDE'];
_obj setDir 134.633;
_base pushBack _obj;
_obj attachTo [_center];
_obj = createVehicle ['Land_CampingChair_V2_F', [(_bPoint select 0) + 1.79492, (_bPoint select 1) + -2.60742, (_bPoint select 2) + -0.0136433], [], 0, 'CAN_COLLIDE'];
_obj setDir 135.633;
_base pushBack _obj;
_obj attachTo [_center];
_obj = createVehicle ['Land_CampingChair_V2_F', [(_bPoint select 0) + 2.37598, (_bPoint select 1) + -1.8457, (_bPoint select 2) + 0.00235367], [], 0, 'CAN_COLLIDE'];
_obj setDir 134.888;
_base pushBack _obj;
_obj attachTo [_center];

Creating the objects works excellently, but the objects stay at 0 azimuth. It's like the command is getting skipped over. I read everything in the BIKI, resetting position doesn't do anything. Also, there were many other threads over the years with issues relating to this command, none of the suggested fixes worked for me. Hopefully we can get this sorted out once and for all.

Thanks in advance.

Share this post


Link to post
Share on other sites

what @Goblin otherwise the only thing that I can remember was that when using the attachTo after you apply the command you may need to use setDir twice. It was a bug I remember but I think they fixed it, I may be incorrect though.

Share this post


Link to post
Share on other sites

Yes, setDir after attachTo. But remember that when you setDir an attached object, the direction set is relative to the object it is attached to, not the compass. So if an object is facing 90 and you attach a chair to it, the chair's initial direction will be 0 if you use setDir on it (although getDir will return the compass direction).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×