Make the Hitscan ray clip through an object that's on a death animation

Maybe I over thought your problem. If you’re just trying to ignore the first and shoot the 2nd then maybe if you check the animation first and then do the the ray cast or pick nearest. I guess it depends on how many targets you have. You might still need to go through the objects by distance.

I made an interesting tower defense example a while back. For efficiency, it used the health extension plus a temporary health. As soon as it was targeted the temp health was deducted. So, when a new target was chosen it would be ignored if the predicted health was zero. Should the projectile miss, the temp health was added back otherwise it was deducted from the real health.

In my example it fires from all 3 towers when you touch. The enemies are draggable.

It used the health to target the weakest. I believe I looped through to look for the one with the lowest predicted health.

I should rework it. I’m sure there’s a lot that I might do differently now but it still has some interesting concepts.

1 Like