How do I pick the last spawn unit instance from a Families?
Develop games in your browser. Powerful, performant & highly capable.
Maybe pick by highest IID
^ Which event should I use to do that?
Another way: every time you spawn a unit update a variable with it's unique id.
variable: latestID[/code:2zaa6yzj] then [code:2zaa6yzj]sprite -> onCreated set variable latestID to sprite.UID[/code:2zaa6yzj] then when you want to pick the latest instance add this to the appropriate event: [code:2zaa6yzj] sprite -> pick by unique id [latestID][/code:2zaa6yzj]
thanks
sorry, the expression is (for a no-variable solution)
System: Pick Sprite by evaluating Sprite.IID = Sprite.Count - 1
thanks a lot
Or even System: Pick Sprite instance Sprite.count - 1 which is the "Pick nth instance" condition under "System" and does the same as the above.