Destroy Actor when hitted by fast block

decaoeudecaoeu PRO Posts: 61
edited July 2012 in Working with GS (Mac)
Guys iam having a hard time to figure that out.

I need an actor to by destroyed only, when hitted by a block who is moving at certain velocity.

I have create a rule that says, when actor BLOCK is FASTER THAN 30, and HIT the CAT, Change Attribute Kill Cat to 1.

Them a put a rule in the cat that says when KILL CAT = 1, Destroy this Actor.

The problem if that, it was that every time a hit 1 cat, all cats in the scene dies, how can a fix that?

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    In your block actor, when it collides with a cat actor, change game.blockspeed to self.speed. In your cat actor, when it collides with a block actor AND game.blockspeed > 30 destroy this actor.

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

  • mithraweptmithrawept Member, PRO Posts: 167
    Is your Kill Cat attribute a game attribute? If so, the you need to have the attribute in the actor, rather than across the whole game. Open the Cat actor and add the attribute in the Attributes box.

    In the rule in your actor code, use the attribute from the actor in the Attribute Browser, rather than your game level Kill Cat attribute.

    Then your kill cat code will operate within the individual actor.

    You might not need the attribute at all though, destroying the actor might work for you.
Sign In or Register to comment.