GameSalad

Howdy, Stranger!

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

Actor does not obey attribute

I'm designing a game in which when an actor collides with a bullet actor, that actor is destroyed. When the actor is destroyed, an attribute is set to 1. If another actor is colliding/overriding the actor destroyed AND the attribute equals 1, then that actor colliding with the actor destroyed is set to be destroyed too. However some of the actors are not being destroyed when this happens, and it is ALWAYS the same ones. They all have the same code so that's not the problem, and I made sure that they all collide/override with each other, so I don't really know anymore what the problem is. Also, they only don't get destroyed when the bullet actor destroys a specific actor, otherwise they do get destroyed. They are all kinda stacked together, could that be the problem? if not what could be causing these actors to not follow the rule?

Comments

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

    @bernardo_chuecos said:
    If another actor is colliding/overriding the actor destroyed AND the attribute equals 1, then that actor colliding with the actor destroyed is set to be destroyed too.

    First of all, make sure that the change attribute behavior is above/before the destroy actor behavior. When you destroy an actor, it ceases running its rules. So if the actor is being destroyed immediately after it changes the attribute to 1, the other actor trying to collide with it won't register a collision. It's hard to know if this is the problem without seeing screenshots of your rules, but that's my guess.

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

  • bernardo_chuecosbernardo_chuecos Posts: 24Member
    edited March 2014

    @tatiang said:
    First of all, make sure that the change attribute behavior is above/before the destroy actor behavior. When you destroy an actor, it ceases running its rules. So if the actor is being destroyed immediately after it changes the attribute to 1, the other actor trying to collide with it won't register a collision. It's hard to know if this is the problem without seeing screenshots of your rules, but that's my guess.

    the destroy behavior was first, I moved it to the bottom but the problem persists.

  • UtopianGamesUtopianGames Posts: 5,686Member
    edited March 2014

    Shooting in the dark a little here but might be worth a shot...I would try a simple Boolean in the actors instead of saying if overlap or collide do XXXX do change self.collide to true (call the self Boolean what you want) and then in another rule do if self.collide is true do XXXX.

    Darren.

Sign In or Register to comment.