Problem with increamenting an attribute!
asemarab
Member, PRO Posts: 4
I'm trying to increament an attribute value by 1 every second, but it always incrementing by 2 every 2 seconds, I never have an odd number, I'm using this formula: game.swichSpawner +1, could anybody clarify what is wrong with this?
Comments
How can you tell ?
I don't understand
I mean how can you tell that 'it always incrementing by 2 every 2 seconds [and] I never have an odd number' ?
Also . . . . I've never really got the thing where an attribute that already exists is duplicated ? You see a lot of this on the forums.
Here you are using a rule, a behaviour (or action) and a timer simply to duplicate the clock attribute that already exists.
You are saying . . . 'when this attribute (called time) increases by 1, then change this other attribute (called switch.Spawner) by 1' . . . but if you want something that changes by 1 every second then there is no need to make it as it already exists, the game's clock already increases by 1 every second, effectively all that these rules and timers are doing are changing the name of the 'it goes up by 1 every second' function from 'time' to 'switch.Spawner'.
Hope that makes sense !
...and @asemarab are you absolutely sure that you only have 1 instance of the actor in question in your scene? - if you have it in your scene twice, it looks like it'll do what you're seeing? (unless your minimised rules have the same rule in there too?)
ie. 2 actors would each fire off the rule, making it increment in 2's every second or so (+/- hundredth's of a second apart, for each actor) - is it deffo happening every 2 seconds, and not every 1?
Maybe use the SCENE tab, and LAYERS explorer, to confirm, if one's invisible/off-screen/behind the other?
I make an actor and just use a Display text in it. Drag it on the scene. I like to see the game attribute changing and know visually whats going on.
That is exactly the case, thank you all guys.