Delete Highest Numbered Actor
robert.mccarthy
Member Posts: 165
Hi All,
I need a little help if anyone can please
What I need to do is:
I have an actor, and when spawned it assigns itself a number +1 larger than the last actor which was spawned. So if I have 5 actors their numbers will be:
Actor 1: #1
Actor 2: #2
Actor 3: #3
Actor 4: #4
Actor 5: #5
Now, what I want to do is when another actor is pressed (Delete Button) I want to be able to delete the actor with the highest value #number.
This is easy, however, within my game I could remove 'Actor 4' so when I delete 'Actor 5' and then press it again, I want it to delete 'Actor 3'.
Hope this makes sense, it does here in my head
Thanks again,
I need a little help if anyone can please
What I need to do is:
I have an actor, and when spawned it assigns itself a number +1 larger than the last actor which was spawned. So if I have 5 actors their numbers will be:
Actor 1: #1
Actor 2: #2
Actor 3: #3
Actor 4: #4
Actor 5: #5
Now, what I want to do is when another actor is pressed (Delete Button) I want to be able to delete the actor with the highest value #number.
This is easy, however, within my game I could remove 'Actor 4' so when I delete 'Actor 5' and then press it again, I want it to delete 'Actor 3'.
Hope this makes sense, it does here in my head
Thanks again,