Jump to content

ditrapanij

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Medals

Posts posted by ditrapanij


  1. Hi All,

     

    Having issues when spawning AI via a function. When I attempt to spawn an enemy using the below set of code:

    _buildings = nearestObjects [(getMarkerPos _marker), ["house"], 400];
    _building = selectRandom _buildings;
    _buildingPositions = [_building] call BIS_fnc_buildingPositions;
    
    _group = createGroup [EAST, true];
    _unit = _group createUnit[(selectRandom EnemyUnits), (selectRandom _buildingPositions), [], 0, "NONE"];

    Enemies will sometimes spawn floating inside the building, on windows, on crates or outside the building.

     

    Is there a more specific function like unit building position that will stop AI spawning on these less than ideal positions?

     

    I imagine this is because of the z field in the buildingPos but would like to see if anyone else has experienced this issue and how they've overcome it?

×