Jump to content
Sign in to follow this  
kibaBG

[SOLVED] setDir with Static Weapons

Recommended Posts

How to set direction to static weapons properly? I try with this but the static weapon is facing north every time ...

_static = [[19173.2,16620.1,0],180,"LOP_ISTS_OPF_Static_AT4",_staticgrp] call BIS_fnc_spawnVehicle;
doStop _static; _static setDir 180;  //I try to make it face south

 

Share this post


Link to post
Share on other sites

I had to edit the code for better understanding but still I have no luck ...😣
Searching the forum for setDir command gave no results. 

Share this post


Link to post
Share on other sites

Check the return value of the function you call for spawning.

Return Value:

Array format [createdVehicle, crew, group]:

createdVehicle: Object - the created vehicle

crew: Array of Objects - the vehicle's crew members

group: Group - created or passed group

See https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle

 

Cheers,

TeTeT

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you so much for the remark 👍. Its working now. This is the code if someone want to spawn static weapon in certain direction: 

private _static2 = [getMarkerPos "static_2",180,"LOP_ISTS_OPF_Static_AT4",_staticgrp2] call BIS_fnc_spawnVehicle;
private _vehicle = _static2 select 0;
_result params ["_vehicle", "_crew", "_group"];
_vehicle setDir 180; _group deleteGroupWhenEmpty true; _group allowFleeing 0;

This creates static ATGM launcher with operator on "static_2" marker location facing south. 

 

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  

×