How to refund entities in the new world?


(Michael Rublev) #1

Hello there,

I have some active warriors in the game room. I need send warriors in new room keeping their parameters. I saved them in static array. After adding them in new world they not visible and not active but new warriors react to them.

for (var i:int = 0; i < GV.listOfWarriors.length; i++ ) {
	add(GV.listOfWarriors[i]);
}

How can I add saved warriors in new room? I try to set this for everyone, but nothing happens:

for (var i:int = 0; i < GV.listOfWarriors.length; i++ ) {
	var warrior:Warrior = GV.listOfWarriors[i];
	warrior.persist = true;
}

Thanks.


(Martí Angelats i Ribera) #2

You have to clone the warriors (need to create the function).