Jump to content
Sign in to follow this  
McArcher

nearestObject question

Recommended Posts

I want to get a closest soldier (doesn't matter which type) to the object.

I use

_man = nearestObject [_crate, "Soldier"];

I have read that Soldier is a sub-class of Man, which is a sub-class of Land and so on...

Read it here - http://community.bistudio.com/wiki/Models_%26_Classnames:_CfgVehicles_-_Class_Man#class_Soldier:_Man

But... this returns a Null-object every time! Why? How can I get nearest soldier or a human being ?

Share this post


Link to post
Share on other sites

_crate should be the position at which the center of the search is performed, maybe you should use getpos _crate instead?

Share this post


Link to post
Share on other sites

no, it is existing crate object.

this

_man = nearestObject [_crate, "Man"];

returns RU_player_2 and so on (names of playable units)... strange...

---------- Post added at 22:06 ---------- Previous post was at 22:06 ----------

I wonder why Soldier doesn't work but Man works...

Share this post


Link to post
Share on other sites

Yes, SoldierEB for east side soldiers works.

---------- Post added at 22:52 ---------- Previous post was at 22:52 ----------

and SoldierWB for west side soldiers

Share this post


Link to post
Share on other sites
Yes, SoldierEB for east side soldiers works.

---------- Post added at 22:52 ---------- Previous post was at 22:52 ----------

and SoldierWB for west side soldiers

As it is since OFP.

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  

×