RabbitxRabbit 1 Posted March 17 I'm having an issue with BIS_fnc_findSafePos. findSafePos only returns two values, for the x and y axes, and I'm trying to use createSimpleObject with it which requires all 3 axes. The error code reads "2 elements provided, 3 expected." Here's what I have down: _pos = [obj1, 1, 100, 1, 1,0.25, 0] call BIS_fnc_findSafePos; createSimpleObject ["Land_HelipadEmpty_F", _pos, false]; Everything in it works fine except that _pos is only x and y. I've subbed in "_pos = [0,0,0]" and it works just fine. I just need to learn how to add the z axis to _pos. Can someone please help me? Thank you in advance. Share this post Link to post Share on other sites
cidfr 18 Posted March 17 You can either modify _pos to add the 0 value for the z axis at the end using pushBack : _pos = [obj1, 1, 100, 1, 1,0.25, 0] call BIS_fnc_findSafePos; _pos pushBack 0; createSimpleObject ["Land_HelipadEmpty_F", _pos, false]; or keep the _pos array unchanged and perform the modifications in a copy using + syntax (see example 3) createSimpleObject ["Land_HelipadEmpty_F", _pos + [ 0 ], false]; Alternatively, you can use select to extract the components to create a new array : createSimpleObject ["Land_HelipadEmpty_F", [ _pos select 0, _pos select 1, 0 ], false]; Share this post Link to post Share on other sites
RabbitxRabbit 1 Posted March 19 On 3/16/2024 at 11:41 PM, cidfr said: You can either modify _pos to add the 0 value for the z axis at the end using pushBack : _pos = [obj1, 1, 100, 1, 1,0.25, 0] call BIS_fnc_findSafePos; _pos pushBack 0; createSimpleObject ["Land_HelipadEmpty_F", _pos, false]; or keep the _pos array unchanged and perform the modifications in a copy using + syntax (see example 3) createSimpleObject ["Land_HelipadEmpty_F", _pos + [ 0 ], false]; Alternatively, you can use select to extract the components to create a new array : createSimpleObject ["Land_HelipadEmpty_F", [ _pos select 0, _pos select 1, 0 ], false]; YES! Thank you! I knew it had to be something simple like that. I tried your first two methods and they both worked perfectly! Thank you again, cidfr! Share this post Link to post Share on other sites