Behavior stop not working
-
I have a rock set to spawn on top of the screen to fall down using spawn area. I also have a person below dodging the rocks. I set up behavior with the rock that when it hits the person it destroys the object and also set up a behavior stop to stop spawning the rocks. Everything works but the behavior stop to stop spawning the rocks.
-
@SplitMindGaming I didn't understand your problem well, but I think that you put the behaviors in the rock's behavior. If the rock is destroyed, it will stop spawning cause the behaviors now don't exist.
Or, you haven't put a Timer or a behavior that trigger multiple times.
So make sure the behaviors are not in the rock's behavior and put a behavior that activate multiple time such as a Timer.
-
Also, don't put anything like this in the Bug Report category. I guess you haven't seen the rules to submit here : https://forum.hyperpad.com/topic/1105/rules-for-making-bug-submissions
You better send this in the Help & Support category.
-
@XxWhiteHearrxX sorry just seen the forum rules. I beleive in this case it is a bug. I have attached screenshot. When the rock collides with the character its suppose to stop the spawn behavior of the rock. But it doesnt. I will try upload file as well.
-
-
The screen shot helped!
The issue is you're recursively spawning.
What I mean is you're spawning rocks, that are spawning rocks.Each rock is a new instance, so a NEW spawn behaviour. So the behaviour off is actually working.... On that original rock. but you've already spawned a new rock by this point, and it will be On.
Put your logic on another object that handles all of this.
Also, you probably don't want to use while colliding, instead use Start colliding, or stop colliding.
While colliding will continuously trigger until they are no longer touching. This may give some odd results. For example, try playing a sound on while colliding, it you will see the isue. -
@Murtaza makes sense. How do i set it up to stop spawning all rocks upon colliding?
-
@SplitMindGaming I would recommend putting your logic that spawns the rocks inside another object. Either inside the player or perhaps inside a new invisible scenery object. If you do this, the behaviour off that turns off the rocks will stop all rocks from spawning. I would also suggest that maybe you should make the rocks delete themselves after some time otherwise they might build up and lag your game eventually.
-
@Aidan-Oxley i will give that a try. Thank you so much for your help.
-
Moved this to Help and support, as it's not a bug.