5 hits to destory (screenshot)

I have a drone gun, and I want to destroy it in 5 hits. I have a property set to equal 5, and remove visibility of it, however how can I add hits each time a bullet touches it?

Meaning if 3 bullets hit it, it has a property of 3, and when it gets to 5, it turns invisible (blown up)

Here is what I have currently.


If the ship there collides with an object with the ‘bullet’ property (Collision sensor with And controller), then add 1 to the ‘hits’ property (Actuator). That should be it.

If you’re using dynamic objects for bullets, set a “Collision” sensor detecting a “bullet” property, an and controller, and a “Property” Actuator that “adds” 1 to the Hits property. If you’re using static objects, use a “near” sensor doing the same thing.

*Edit: Jinx! You owe me a soda.
Just kiddin’

Didn’t make much progress, added the things I thought would work, but after like 20 shots, nothing happens. The gun turret you see in the picture, that needs to go away when hit by a bullet.


Is the bullet traveling at a set velocity, or is it using a force? If it’s a set velocity, it won’t recognize the collision. Try using a near sensor that’s adjusted to fit it’s bounding box.

Also, make sure the property’s an integer, I’ve forgotten this step often.

Edit: Actually, from your screenshot, it appears you haven’t added the hits property to it. I don’t see the property box under the “add property” button.

Here is the bullet properties.


I see your problem (I think)

First off, the bullet is a static object. Use a “Near” sensor to detect it, using Loc will not register a collision.
Secondly, select the drone and press the “Add Property” button. Name it “hits”. Change it to an integer by clicking the button that says “Float” and select “Int” This should resolve your issues.

Am I getting closer? here is the drone update.


Did you also give the bullet the property bullet? If so, then this should work.

What do you mean? can you explain it?

Just like how you had to add a property named “hits” to the drone, you must add a property named “bullet” to the bullet object. That’s the property the near sensor is looking for.

Sadly it still doesn’t work, unless I am not doing it correctly.



You have the “hits” property assigned to the bullet. You need to assign the “hits” property to the drone, and a property named “bullet” to the bullet.

Okay that’s done, here is the screenshots of the new changes. Sorry I am still a beginner at this.



It’s okay, We all start somewhere, I’m just happy to help you figure it out.

At any rate, is it still not working? It seems correct to me…

I would change your setup.
First, both of them need to be actors, enable ACTOR on the bullet.
Enable the TAP button on the near sensor.

Enabled tap and made bullet actor, still no changes.

does it not work?
IF NOT POST THE BLEND!

It’s not working for me. Here is the blend. Also the tracking isn’t correct, the guns face away from me instead of pointing at me.

www.rodgame.org/3D/fpsgame.blend
File Size: 7MB
Version: 2.49B

Ok I got it where it disappears in one single hit. But it needs to be 5 hits. I can’t get it to do more than 1.