I created an actor model and assigned it to a variable. When I send the actor a message by the last created actor function, it always works. However if I assign the last created actor to a variable, some messages work sometimes and other messages don't work at all. An example:
Create actor model;
lastCreatedActor = (last created actor function);
sendMessage(setHeight(1)) to lastCreatedActor (the variable); //this works
Wait 4.0 Game time seconds;
sendMessage(setHeight(2)) to lastCreatedActor (the variable); //this fails
however if i replace the above line with: sendMessage(setHeight(2)) to last created actor (the function), it works just fine.
another example of this is with the destroy message:
sendMessage(destroy()) to last created actor (the function) //this works
sendMessage(destroy()) to lastCreatedActor (the variable) //this fails
overall, it seems random whether I can use a variable or I have to use the last created actor function when sending a message to an actor.
I need this to work because I want to create an actor in one trigger and then destroy it in another trigger. This can only be accomplished by saving it to a variable for reference in the trigger that it wasn't created in.
Another bug I found with this is the sendMessage(setScale()) function.
sendMessage(setScale(2,2,2)) to lastCreatedActor (the variable); //this works
sendMessage(setScale(.1,.1,.1)) to lastCreatedActor (the variable); //this fails
sendMessage(setScale(.1,.1,.1)) to last created actor (the function); //this works
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Possible bug with triggers and actors