How to make actors collide, but only sometimes?

AshumBesherAshumBesher Member, PRO Posts: 122

I want to make an actor only be able to collide with others under certain conditions or for certain time limits. It seems that once the collide behaviour runs, it will keep running with no way to stop it unless it's destroyed or the scene is changed. I've tried putting collide behaviours in timers to only run for X seconds but no luck, I've tried making rules to only collide under specific conditions but no luck there either, it continues to collide for the rest of the scene.

Is there some obvious solution I've not thought of? Or is this this an overlooked GameSalad issue? Any help would be appreciated.

Comments

  • bob loblawbob loblaw Member, PRO Posts: 793

    you should be able to use rules based on what you’ve described.

    to use an example, a basic platformer uses the condition that a platform only collides with the player, when the player’s y position + height/2, is greater than the platform’s y + height/2 (rule contained within the platform, and a global variable constrained to the player y).

  • AshumBesherAshumBesher Member, PRO Posts: 122

    An example of what I've tried is having a simple rule: When game attribute is true, collide with actor.

    When the attribute is true, it triggers the collisions. But it carries on colliding after the attribute changes back to false.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    These are the kinds of things that can be confusing as a new user of GameSalad but that are pretty straightforward when it comes to programming. If an attribute has a certain value and you have a rule condition based on that attribute value, then the rule will fire. So if it's not firing, there's a problem with your other rules or where you've placed that one particular rule.

    How do you know the attribute "changes back to false"? Do you have a Display Text for that value and you've watched it the whole time?

    Post a screenshot of your collision rule and any rules that change the value of that attribute and we'll see what might be causing this issue.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • AshumBesherAshumBesher Member, PRO Posts: 122

    Thanks for your help. I fixed my problem.

Sign In or Register to comment.