How do I move a an actor when two other actors collide?

bij_sbij_s Member Posts: 23

Let's say you want an actor to move when two other actors collide. How do I make that happen?

Comments

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

    This is what game attributes are for: to communicate between actors. You'll need a boolean attribute which you can call game.collided. Set it to false (unchecked).

    In your colliding actors:

    If actor collides with [other actor] Change attribute game.collided to true

    Then in the actor you want to move:

    If attribute game.collided is true Move...

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

Sign In or Register to comment.