Help with actor collision?

turkeymanturkeyman Member Posts: 3
edited July 2014 in Help Wanted

Hi, guys.

I'm making my first game on GameSalad, and I want to change the attribute of actor A after it collides with actor B. I want to make it so that actor A can touch actor B for as long as it wants, and the attribute doesn't change until they stop touching. How do I do this?

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    You can create a game integer attribute. Call it "CollisionTrue" or something like that. Keep its initial value at 0.

    In Actor A, create a rule:
    When actor overlaps or collides with Actor B,
    -- Change Attribute: Game.CollisionTrue to 1
    - Otherwise:
    - - Change Attribute Game.CollisionTrue to 0
    

    The Game.CollisionTrue attribute will be set to 1 when the collision is true. You can then use that condition to fire off whatever you need to happen in your game.

  • turkeymanturkeyman Member Posts: 3

    This is also my first question. I hope I posted it in the right place...

  • turkeymanturkeyman Member Posts: 3

    Thanks! It worked!

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    Great! Glad it's working!

Sign In or Register to comment.