GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Help with actor collision?

turkeymanturkeyman Posts: 3Member
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 Posts: 9,115Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee

    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 Posts: 3Member

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

  • turkeymanturkeyman Posts: 3Member

    Thanks! It worked!

  • Braydon_SFXBraydon_SFX Posts: 9,115Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee

    Great! Glad it's working!

Sign In or Register to comment.