Event on update
NRaf
Member Posts: 4
Hey,
I was wondering how I could go about calling an event whenever an attribute is updated? Also, in the event (or rule) that is called, I want the timer to be reset. How can I do this?
I was wondering how I could go about calling an event whenever an attribute is updated? Also, in the event (or rule) that is called, I want the timer to be reset. How can I do this?
Comments
If the change in the attribute is caused by another game event (like a collision), you could create a Boolean global variable game.collision (for example) that is set to true whenever the game event occurs. Then you could set the rule to trigger whenever game.collision is true. Within the called rule you must use Change Attribute to set game.collision to false to set it back up again.
If you're dealing with something that continuously updates like actor.position.x, that's entirely difficult.