beeper 10 Posted August 16, 2021 I want to attach "CBA_B_InvisibleTargetVehicle" to my empty vehicles, so enemy will attack these vehicles, but I need to find offset for "attachTo" command arguments, any help? If I set zero offset attachTo [_this, [0, 0, 0]]; then invisible target hides in vehicle hull (enemy don't react, don't see target), so only I can is put target on top of it. Is it possible to find correct offset, so target will be visible to enemy AI but not so far so AI will hit target vehicle. Thanks! Share this post Link to post Share on other sites
sarogahtyp 1105 Posted August 16, 2021 maybe this could work for your situation (objA should be on ground during execution): _obj = objA; _obj_to_attach = objB; _pos_obj = position _obj; _bbr = boundingBoxReal _obj; _p1 = _bbr select 0; _p2 = _bbr select 1; _maxHeight = abs ((_p2 select 2) - (_p1 select 2)); _pos_obj set [2, _maxHeight]; _attach_pos = _obj worldToModel _pos_obj; _obj_to_attach attachTo [_obj, _attach_pos]; objA - the object which gets an attachment (objB) objB - the object which gets attached to objA 1 Share this post Link to post Share on other sites
beeper 10 Posted August 17, 2021 I have Integrated this code with this result (too high), any ideas? Share this post Link to post Share on other sites
sarogahtyp 1105 Posted August 18, 2021 the script uses boundingBoxReal to find the highest point of the object. In your screenshot this is the top of the highest antenna. it is possible to detect a lower point beside the antenna with lineIntersectsSurfaces but this is an effort which Im not recommending if not really needed. Better way would be to do a manual solution for this specific object type like: _obj = objA; _obj_to_attach = objB; _height_correction = [ [ "tank1_classname", -2 ], [ "car12_classname", -1.5 ], [ "towerA_classname", -4.37 ] ]; _pos_obj = position _obj; _bbr = boundingBoxReal _obj; _p1 = _bbr select 0; _p2 = _bbr select 1; _maxHeight = abs ((_p2 select 2) - (_p1 select 2)); _index = _height_correction findIf { typeOf _obj == (_x select 0) }; if not ( _index < 0) then { _maxHeight = _maxHeight + (_height_correction select _index select 1); }; _pos_obj set [2, _maxHeight]; _attach_pos = _obj worldToModel _pos_obj; _obj_to_attach attachTo [_obj, _attach_pos]; 1 Share this post Link to post Share on other sites