Need help resolving Triple Hit Issue

RodericRoderic Member Posts: 145
edited November -1 in Working with GS (Mac)
I'm making a shooter type game. The shooter can hit one or more targets with every shot. I want to be able to track when the shooter has hit 3 or more targets with one straight shot and I'm stuck. I set up an attribute as the counter.

I can get the count of each hit, but sometimes after hitting one or two targets, it ricochets off something and then hits another target by accident. I don't want to count that one. I only want to count the ones that are hit on the initial shot, straight out, not targets on the rebound.

Any suggestions?

Thanks!

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    You could use a boolean that registers when it ricochets off something.

    So, if that happens, ricochet = true

    Then, when the bullet hits a target have a rule that says 'if richochet = false AND you hit the target, count as 'proper shots'.

    Every time you shoot, change ricochet to false.

    That might work - give it a go!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • RodericRoderic Member Posts: 145
    Thanks QS, let me give that a shot.
Sign In or Register to comment.