How do I check if a bullet bounced? (Solved)

0 favourites
  • 5 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • I have a bullet with the "Bounce Off Solids" enabled. I'm trying to increase a counter when it bounces, so that it can only bounce three times. But there doesn't seem to be a way to detect when the Bounce Off Solid occurs.

    I've tried stepping and testing for overlaps, but that locks up the program (granted I may be doing this wrong).

    If there's no trigger or way to detect a bounce, is there a manual calculation to set the new bounce angle?

    Thanks for any help!

  • Use the on collision with trigger rather than testing for overlaps.

    EDIT: if for some reason you did want to manually set the Bullet ricochet using events:

    Bullet 'On Collision With' Wall

    - Bullet Set bullet Angle Of Motion to (angle of surface hit-(Bullet.bullet.angleofmotion/2))*2

    Sub Event:

    If Bullet.bouncecountervariable<>3 - Add 1 to bullet.bouncecountervariable

    If Bullet.bouncecountervariable=3 - destroy Bullet

  • Thanks, that definitely helps - but it doesn't allow for the On Step bullet trigger, so the collisions are much less accurate. I'll see if I can adjust the bullet's position once it's collided. Maybe an On Bounced trigger is a suggestion for the new ideas platform.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • if you need to use on step use this:

  • That's a great solution, thank you very much!

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