GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Destroyed actors are being "reused" when spawned

thegwillthegwill Posts: 31Member
edited November -1 in Working with GS (Mac)
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?

Comments

  • ORBZORBZ Posts: 1,303Member
    That's very interesting.

    Does it happen all the time or after a certain duration or number of spawns?

    How long is the delay between destroy and spawn?
  • thegwillthegwill Posts: 31Member
    It appears to reuse as often as it can and only spawn when it has "run out" of previously destroyed items.

    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?
  • BarkBarkCoBarkBarkCo Posts: 1,400Member
    I've seen this before where spawning/destroying of the same actor class results in recycled attributes in "new" instances. I had a game that exhibited this consistently, lemme see if I can find it...
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    We are aware of this issue. Thanks.
This discussion has been closed.