GameSalad

Howdy, Stranger!

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

Change tag or actor attribute that other actors can read

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 Posts: 11,868Member, Sous Chef, PRO, Senior Sous-Chef

    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 Posts: 559Member
    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 Posts: 2,830Member, Sous Chef, PRO

    @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 Posts: 559Member

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

Sign In or Register to comment.