- Home /
Question by
ITCodeeersss · Feb 25, 2018 at 06:43 PM ·
destroyarray of gameobjectshealth
How can i remove the player in an array?
i have public PlayerMovement[] players;
here is my code.
void Update () { if(players[currentPlayer].MoneyAmount <=0){ Destroy (players[currentPlayer]); PrintToLog("The Player "+(currentPlayer+1) + "was dead."); } }
how can i remove the current player in my array?
Comment
Your answer
Follow this Question
Related Questions
health decrease only once and stop player movement 1 Answer
C# issue, health, and destroying affect other objects. 3 Answers
Only destroy one instatnce 1 Answer
C# error help ( CS0023 Operator '--' cannot be applied to operand of type 'Stat' 1 Answer
Why does this do nothing (Health Script) 2 Answers