Jump to content
Sign in to follow this  
Spriterfight

Help with _this select 0;

Recommended Posts

How can i select an already spawned unit?

So i have a unit in the editor and i want to select it with select command because i dont want to use global variable


_unit = _this select 0;
_playerGrp = group _unit;
_pos1 = getMarkerPos "tankwest1";
_wp = _newGrp addWaypoint [_pos1,0];
_wp setWaypointType "MOVE";
_wp setWaypointSpeed "Full";
_wp setWaypointBehaviour "Aware";

 

I put this in his init but the unit doesnt move.So how can i use select command to select the current unit without give it a globalvariable?

Share this post


Link to post
Share on other sites

If using the Editor, just use.... this   to refer to itself.

 

Example:

this doMove getMarkerPos "tankwest1";

  • Thanks 1

Share this post


Link to post
Share on other sites
5 minutes ago, Von Quest said:

If using the Editor, just use.... this   to refer to itself.

 

Example:

this doMove getMarkerPos "tankwest1";

_playerGrp = group this; 
_pos1 = getMarkerPos "tankwest1"; 
_wp = _newGrp addWaypoint [_pos1,0]; 
_wp setWaypointType "MOVE"; 
_wp setWaypointSpeed "Full"; 
_wp setWaypointBehaviour "Aware"; 
still dosn't move

Share this post


Link to post
Share on other sites

_newGrp hasn't been defined anywhere. Is that meant to be _playerGrp?

  • Thanks 1

Share this post


Link to post
Share on other sites
2 minutes ago, beno_83au said:

_newGrp hasn't been defined anywhere. Is that meant to be _playerGrp?

Thank you for your observation i didnt notice it

  • Like 1

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  

×