SImple Collision question

daverennerdaverenner Member Posts: 133
edited November -1 in Working with GS (Mac)
I have an object that has a limited amount of "hit points". Everytime it collides with objects i need it to subtract 1 point. The problem is, sometimes it subtracts 3 points or 7 points etc. Is that due to it hitting an object and sitting there for a split second to long so it sees it as multiple collisions? How would i fix this?

Thanks...dave

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    It is probably hitting it multiple times as it shakes a bit.

    Try this

    Rule - when actor overlaps with other actor
    Timer - after .1 seconds
    -----change self.hitpoints to self.hitpoints-1

    Be sure to leave run to completion UNchecked. That way it will only subtract if it is still touching after .1 seconds. if it is still too touchy change .1 to .2 or .3 - just experiment with it until it works how you think it should.
Sign In or Register to comment.