Change tag or actor attribute that other actors can read

fmakawafmakawa Member Posts: 559

Hi folks,
I was wondering if you can have an actor change its tag after collision? I have a bunch of actors that when they collide they expand. I dont want to then trigger other collisions as a result of this expansion. Currently these collisions are linked to particular tags so I was wondering if it were possible to change tags. If there is an alternate way I'll gladly hear it.

Comments

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

    If actor collides with actor [actor name] AND self.alreadyExpanded is false
         [expand]
         change attribute self.alreadyExpanded to true

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

  • fmakawafmakawa Member Posts: 559
    edited April 2016

    @tatiang okay but consider this. If Actor A and B collide under the initial collision the both expand and there is a bit of a bounce but if they collide when one of them is expanding then the other doesn't expand but just disappears with no bouncing. Essentially, the actors have 2 different states of being (which is normally a self attribute and recognising self attributes for other actors seems not possible and wouldn't work as global attribute.) hmm

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,862

    @fmakawa -- tags are text attributes. You can add a tag to an actor by using a change attribute behavior. For example:

    When (All)
    Actor receives event: overlaps or collides with Actor of type: Enemy 1
    Attribute: self.Tags does not contain: Expanding
    -- Change Attribute: self.Tags To: Expanding

  • fmakawafmakawa Member Posts: 559

    Ahhhhh said the blind man! Thanks for the clarification @RThurman

Sign In or Register to comment.