Destroyed actors are being "reused" when spawned
thegwill
Member Posts: 31
I have an actor which is spawned every few seconds and heads across the screen from left to right. The actor also has a counter which increments during its journey across the screen. At the right side it is destroyed using the Destroy behaviour.
I've added a DisplayText to show each actor's counter for debugging purposes.
All is well... until some of the actors reach the other side and then disappear (as expected). But, then they are spawned back on the left side and their counter has continued to increment whereas I'm expecting the counter to be reset to zero given that the actor has been spawned.
I assumed that spawning an actor was basically creating a new instance - is that incorrect?
I've added a DisplayText to show each actor's counter for debugging purposes.
All is well... until some of the actors reach the other side and then disappear (as expected). But, then they are spawned back on the left side and their counter has continued to increment whereas I'm expecting the counter to be reset to zero given that the actor has been spawned.
I assumed that spawning an actor was basically creating a new instance - is that incorrect?
Comments
Does it happen all the time or after a certain duration or number of spawns?
How long is the delay between destroy and spawn?
I just bound the DisplayText to the actor.Time and on the "reused" ones the time stays at the time when it was first destroyed.
Do any of the engine coders read this stuff?