NunesSergio 17 Posted June 13, 2022 Hello there! I'm trying to account for soldiers being spawned inside of rocks, so I figured I'd draw a line upwards above the soldier's head, pick the object of the first surface the line touches and call it a day. The thing is, the command does not throw me classname objects, it throws me proxy objects (p3d). Here is my code: _pos = getPosASL _unit; _objs = lineIntersectsWith [_pos, _pos vectorAdd [0,0,10], _unit]; _objs //This gives me: [155305: sharprock_spike.p3d] As you can see, that's just the kind of object I want to detect. But passing it through isKindOf doesn't help. Other "line" commands (lineIntersectsObjs, lineIntersectsSurfaces, etc), give me the same result. How can I detect if that object is a rock? The only thing I could think of was to convert that using str and check for "rock" in the resulting string, but I assume that's just sloppy and could cause some false alarms. Share this post Link to post Share on other sites
Harzach 2517 Posted June 13, 2022 Have you tried BIS_fnc_findSafePos? 1 Share this post Link to post Share on other sites
NunesSergio 17 Posted June 13, 2022 3 hours ago, Harzach said: Have you tried BIS_fnc_findSafePos? Yes I use this a lot, but when spawning a whole group, the safe position is only guaranteed to be the group leader's. The other members spawn in formation (or any other) and can end up more often than not under terrain rocks 😞 I just didn't want to use findSafePos for every single unit I spawn. Share this post Link to post Share on other sites
Harzach 2517 Posted June 13, 2022 1 hour ago, NunesSergio said: but when spawning a whole group Make sure your value for objDist (fourth param) is greater than the size of your group's formation footprint. 2 Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 14, 2022 This is of course the best solution: 12 hours ago, Harzach said: Have you tried BIS_fnc_findSafePos? Nevertheless there are ways to detect rocks which have no classnames. If you do not get a classname (using the typeOf command) which you could examine then you have the option to get nearby terrain objects with nearestTerrainObjects. 1 Share this post Link to post Share on other sites