Change tag or actor attribute that other actors can read
fmakawa
Member Posts: 565
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
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
@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
@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
Ahhhhh said the blind man! Thanks for the clarification @RThurman