Spriterfight 10 Posted July 31, 2020 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
Von Quest 1163 Posted July 31, 2020 If using the Editor, just use.... this to refer to itself. Example: this doMove getMarkerPos "tankwest1"; 1 Share this post Link to post Share on other sites
Spriterfight 10 Posted July 31, 2020 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
Spriterfight 10 Posted July 31, 2020 the unit is assigned to a group Share this post Link to post Share on other sites
beno_83au 1369 Posted July 31, 2020 _newGrp hasn't been defined anywhere. Is that meant to be _playerGrp? 1 Share this post Link to post Share on other sites
Spriterfight 10 Posted July 31, 2020 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 1 Share this post Link to post Share on other sites