How do I count bullet collisions?

  • So I've got some bullets. They bounce off of solids. I want them to disappear after three of those bounces. How do I do that?

    I thought it would be as simple as adding 1 to an instance variable with each bounce, then destroying the bullet when that variable reaches 3, but the problem is that there doesn't seem to be any kind of 'on-collision' event. There's 'on-collision-with-a-specific-object', but not 'on-collision-with-any-solid' by the looks of things. Surely I don't need a separate event for every solid object in the game?

    So, um, what do I do?

  • Create a Family with the objects you want it to collide against and then test vs that.

  • Thanks a ton! Shame families are only in the full version.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just a thought , what if you compared the bullets angle and then added to a variable , according to the manual............AngleOfMotion

    Get the angle the bullet is currently moving at (which can be different to the object's angle), in degrees. This changes when the bullet bounces , might be worth a try ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)