Problem With Spawn and Integer
I don't use spawn a lot in my game so not sure if i have missed this one...
I have a spawn actor that spawns actor X and for the timer i have a game.integer game.timer set to 5 so every "game.timer" spawn actor X.
It works fine until i want to change the game.timer down to lets say 2 so it spawns more frequently.
Now I'm sure this used to work so have a missed a bug or a trick with this?
Darren.
FREE GS Templates
FREE GS Tools
Video Tutorials
Forum
3rd party marketplace
I have a spawn actor that spawns actor X and for the timer i have a game.integer game.timer set to 5 so every "game.timer" spawn actor X.
It works fine until i want to change the game.timer down to lets say 2 so it spawns more frequently.
Now I'm sure this used to work so have a missed a bug or a trick with this?
Darren.
FREE GS Templates
FREE GS Tools
Video Tutorials
Forum
3rd party marketplace
Comments
I have worked round it but never came across it before as I'm sure i did something similar a while back with no problems.
Darren.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Change Attribute self.changeTime to random(2,30)
Every self.changeTime seconds
- Change Attribute game.direction to (game.direction+1)%2
- Change Attribute self.directionChanged to True
When self.directionChanged is True
- Change Attribute self.changeTime to random(2,30)
- After 1 second: Change Attribute self.directionChanged to false
This code causes the actor to change direction only at the time initially set in the first behavior, and doesn't update throughout the game. self.changeTime changes its number like it is supposed to, but the new number is not replacing the old number in the timer. Anyone know what I'm doing wrong with this? or is this some crazy bug?
Darren.