change image of an actor issue
POM
Member Posts: 2,599
hey guys can you help me out here please..
i have an actor that spawn other actors every time the key is pressed,
my goal is that after 10 seconds the spawned actor's image will change without changing
the previous spawned actors.
i tried to give a rule that changes the image with a timer(after 10 sec)to a new image, BUT, the change starts with the first spawned actor..
i have an actor that spawn other actors every time the key is pressed,
my goal is that after 10 seconds the spawned actor's image will change without changing
the previous spawned actors.
i tried to give a rule that changes the image with a timer(after 10 sec)to a new image, BUT, the change starts with the first spawned actor..
Comments
Maybe have one game attribute counter called "NumOfActorXYZSpawned" that gets incremented each time an actor of type XYZ is spawned. Then in each XYZ actor spawned, you have an actor prototype attribute called "SpawnNumber" that gets set to the new value currently in "NumOfActorXYZSpawned". This allows a sort of unique ID to be associated with each spawned XYZ actor.
Then you could have a 10 second timer rule in your scene controller actor (or wherever) that sets another game attribute to the current at-that-exact-moment value of "NumOfActorXYZSpawned" (i.e. retaining the XYZ count at the 10 second mark). Call this new attribute "ActorXYZSpawnWaterLevelMark" or something - setting it to zero initially.
Then have a rule in the Actor XYZ prototype that says if "NumOfActorXYZSpawned" is not zero and if "SpawnNumber" is greater than or equal to "NumOfActorXYZSpawned", change my image (since if this is the case, you know you have an actor spawned after the 10 second "water level" mark).
The one caveat would be to ensure you are not spawing things actor XYZ in a parallel or nearly parallel manner since the increment of "" may not occur in time between spawns (but would still technically work it is just the instance IDs wouldn't be unique if you use them for anything else).
i understand more or less the idea you tried to tell me, but im afraid its a bit much to my current knowledge with the software.
however, i realized that its not the timer action i want to use, but a speed function.
means, i have an actor that spawn an image every 0 second (all the time),
i want the image that is spawned to change depending on the actors velocity.
so if my actor moving slow(regular speed) it spawn image 1 , and if it moves fast it will spawn image 2
hope im not to annoying and thank you for your help.