chronicsilence 12 Posted August 26, 2015 I have a Darter drone that I create, and I need to set a waypoint on an object for it to move to and follow. This is easy in the editor, but I need to do it dynamically from a script in the mission. This is what I have so far: _vehicle = createVehicle ["B_UAV_01_F", getMarkerPos "UAV_spawn", [], 10]; createVehicleCrew _vehicle; _uavGroup = createGroup west; [_vehicle] join _uavGroup ; _waypointObject = createVehicle ["B_Soldier_02_f", [3800, 13000, 0], []]; _waypoint = _uavGroup addWaypoint [[0,0,0], 0]; _waypoint waypointAttachObject _waypointObject; _waypoint setWaypointType "FOLLOW"; systemChat format["Waypoint position: %1", waypointPosition [group _vehicle, currentWaypoint group _vehicle]]; So, with this code one would think that I create a new waypoint with position [0,0,0], then attach that waypoint to the object I want the Darter to move to and follow (and since I attach it to something, the initial creation position shouldn't matter). However, it just results in the "waypoint position" being [0,0,0] and the Darter flying off to the corner of the map. Anyone know what the proper code would be to have the UAV move to and follow the object? Share this post Link to post Share on other sites
SilentSpike 84 Posted August 26, 2015 You would need to use waypointAttachVehicle, however this command doesn't work on any objects that weren't placed in the editor. The doFollow command might work for what you want though. Share this post Link to post Share on other sites
jinker 19 Posted April 2, 2016 while {true} do { if (unitName distance UAV > 100) then { UAV move position unitName; }; sleep 5; }; Share this post Link to post Share on other sites
sarogahtyp 1104 Posted April 2, 2016 use this in your script to ensure the wp is set as current wp _uavGroup setCurrentWaypoint _waypoint; check the wp position with _wppos= getWPPos _waypoint; Share this post Link to post Share on other sites