Some rules stop working when gravity is on
Dues
Member Posts: 1,159
When i set gravity i a scene, some rules wont work anymore. Any thoughts on this?
Comments
Ive posted some rules here so you can se.
Basically I have an actor that I can move around with my mouse (its supposed to be tossed when gravity is on) that collect items.
When an item is collected I move the collected actor out of screen an call on that actor when i need it. When I complete a level I have a pause menu, and from that menu I can either "retry" "go to menu" or "next level". I have three booleans that triggers the different changes (reset,menu,next)
When gravity is off all those things work perfectly, but when I go into scene an change the Y gravity to eg 800 all my buttons stop working properly. What happens is that instead of unpausing the game and trigger the booleans and attributes set up, the game just unpauses, after that nothing more happens and Im back to the scene the way it was before pausing.
http://imageshack.us/a/img46/4538/skrmavbild20130324kl124.png
http://imageshack.us/a/img11/4538/skrmavbild20130324kl124.png
http://imageshack.us/a/img820/4538/skrmavbild20130324kl124.png
http://imageshack.us/a/img23/4538/skrmavbild20130324kl124.png
http://imageshack.us/a/img826/6378/skrmavbild20130324kl124y.png
http://imageshack.us/a/img826/4538/skrmavbild20130324kl124.png
Hope this makes it a little more clear ">
You need to Think order or operations
First of all if your rule is sold based on touch is pressed the behaviors in that rule will stop running if the touch is released before they are done. And secondly if the first behavior in the rule negates the rule or changes the scene everything else stops.
So you have all of your unpause rules firing prior to the attribute changes. And your other rules negates the rule before the rest of it can run.
Again I'm not sure why gravity would hurt this maybe since its using up ram those rules are not firing fast enough to account for the improper code...
I would also suggest not using gravity and instead place an accelerate down behavior in each actor you want affected by gravity.
Cheers
Aaron.
Thank you for your answers! Are all my rules messed up mainly because of the order, or are they just messed up totally? :-?
If its still not working I would try to find a different way to reduce the touch is pressed rules down you just a change attribute.
I would also probably not try to change an attribute a rule is based on from inside that rule at least not when there's a change or reset scene involved. maybe reset all of those attributes at the begining on the scene loading. Remember to make sure they reset before it gets back to the change scene or reset scene rule again.
GS read the actors from the bottom of the the layer list to the top. And then the rules inside the actor from too to bottom.
So you want your change attributes to reset everything in the very bottom actor at the very top if that actors rules list. Hope that helps its kinda tough explain it all from my phone but I think your on the right track.