# how to destroy gun turret ammo projectile?

**URL:** <https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925>\
**Category:** Community & Industry Discussion\
**Tags:** error, project, turret, unreal-engine, question\
**Created:** [January 25, 2015, 3:01am UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925 "2015-01-25T03:01:50Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaknat\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaknat\_1](https://forums.unrealengine.com/u/Shaknat_1)\
**Post date:** [January 25, 2015, 3:01am UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/1 "2015-01-25T03:01:50Z")

</div>

hi. how do i destroy ammo projectile after it has spawned with a delay :)? because ive tried loads of different methods but the ammo projectiles just collect and eventually causes the play in editor mode to exit used blueprints as well.

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [January 25, 2015, 11:02am UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/2 "2015-01-25T11:02:04Z")

</div>

Hey, what is an “ammo projectile”? Do you mean the shell that flies away to the left or right of your weapon after you shot? Or do you mean the projectile itself? How did you create the ammo projectile? Is it a simple blueprint?

Please show me your blueprints (spawn and the ammo projectile) and show me what you have tried till now, so i can try to help you (:

---

<div class="post-metadata">

**Author:** ![happo5ai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@happo5ai](https://forums.unrealengine.com/u/happo5ai)\
**Post date:** [January 25, 2015, 11:45am UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/3 "2015-01-25T11:45:08Z")

</div>

The easiest way to achieve a despawn regardless if the projectiles have hit something or not would be to set a lifespan.

---

<div class="post-metadata">

**Author:** ![Shaknat\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaknat\_1](https://forums.unrealengine.com/u/Shaknat_1)\
**Post date:** [January 25, 2015, 1:26pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/4 "2015-01-25T13:26:15Z")

</div>

its a standard projectiles that is spawned by my turret gun 🙂

 ![27848-turret+blueprints+(spawn+origin).png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/0/130f04d6e45d83fa1b3f505430c88fa490cbf7e8.png)

---

<div class="post-metadata">

**Author:** ![Shaknat\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaknat\_1](https://forums.unrealengine.com/u/Shaknat_1)\
**Post date:** [January 25, 2015, 1:39pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/5 "2015-01-25T13:39:43Z")

</div>

here is a screenshot showing the result in play mode.

 ![27849-turret+gun+result.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/c/a5c8b0537adafda436be9fa6cf5c74b8aa48eac5.png)

---

<div class="post-metadata">

**Author:** ![Shaknat\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaknat\_1](https://forums.unrealengine.com/u/Shaknat_1)\
**Post date:** [January 25, 2015, 1:58pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/6 "2015-01-25T13:58:17Z")

</div>

how would i

 ![27850-ammo+pro.+blueprints.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/d/76d8c1924dbd2401ac4c4e0340cc5149353ba584.png)

set the lifespan in my blueprint :)?

---

<div class="post-metadata">

**Author:** ![happo5ai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@happo5ai](https://forums.unrealengine.com/u/happo5ai)\
**Post date:** [January 25, 2015, 2:24pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/7 "2015-01-25T14:24:18Z")

</div>

Im not even sure what you want to achieve with this blueprint code but you code set the initial life span in the default values or you could say trigger the lifespan after you received a hit event that would be like in the picture.

![27874-lifespan-blueprint.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/5/a5534af0049b23d2eb2b8c8b36ad6a21a1d76e2e.png)

You could also set it with the same node in the construction script if you want different lifetimes corresponding on some other value.

---

<div class="post-metadata">

**Author:** ![Shaknat\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaknat\_1](https://forums.unrealengine.com/u/Shaknat_1)\
**Post date:** [January 25, 2015, 2:30pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/8 "2015-01-25T14:30:33Z")

</div>

i just want the projectile to disappear after a few seconds of hitting the floor 🙂

---

<div class="post-metadata">

**Author:** ![happo5ai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@happo5ai](https://forums.unrealengine.com/u/happo5ai)\
**Post date:** [January 25, 2015, 2:35pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/9 "2015-01-25T14:35:18Z")

</div>

Well if the collision and stuff works you could also use the delay node and call after that destroy actor.

---

<div class="post-metadata">

**Author:** ![Shaknat\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaknat\_1](https://forums.unrealengine.com/u/Shaknat_1)\
**Post date:** [January 25, 2015, 4:06pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/10 "2015-01-25T16:06:40Z")

</div>

ive added the set the life span like in your screenshot but they are not disappearing 😕 could some other factor effect this ?

---

<div class="post-metadata">

**Author:** ![happo5ai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@happo5ai](https://forums.unrealengine.com/u/happo5ai)\
**Post date:** [January 25, 2015, 4:11pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/11 "2015-01-25T16:11:07Z")

</div>

> **[AActor::SetLifeSpan](https://docs.unrealengine.com/5.0/en-US/API/Runtime/Engine/GameFramework/AActor/SetLifeSpan/)**
>
> Set the lifespan of this actor.

well at least something should be destroyed maybe you have the wrong target when calling this.

---

<div class="post-metadata">

**Author:** ![Shaknat\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaknat\_1](https://forums.unrealengine.com/u/Shaknat_1)\
**Post date:** [January 25, 2015, 5:33pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/12 "2015-01-25T17:33:38Z")

</div>

isn’t working. is there a way to trigger an event when the player collides with the turret gun trigger box, the gun trigger is activated then another event to stop when out of the trigger box :)?

---

<div class="post-metadata">

**Author:** ![happo5ai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@happo5ai](https://forums.unrealengine.com/u/happo5ai)\
**Post date:** [January 25, 2015, 6:31pm UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/13 "2015-01-25T18:31:06Z")

</div>

if the collisions are setup correctly you could overwrite the actorbeginoverlap / actorendoverlap events but that would be a completely new topic. Did you debug your blueprint with the set lifetime and did you try the other way with delay + destroy?

---

<div class="post-metadata">

**Author:** ![Stormrage256](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/stormrage256/32/1008648_2.png) [@Stormrage256](https://forums.unrealengine.com/u/Stormrage256)\
**Post date:** [January 28, 2015, 9:52am UTC](https://forums.unrealengine.com/t/how-to-destroy-gun-turret-ammo-projectile/304925/14 "2015-01-28T09:52:08Z")

</div>

You could try something similar to this:

 ![28224-fire.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/7/d/17dd4d7efd85d90f45b02cfa0c827a8a55116f6e.jpeg)

What I did was to set the life span of the projectile as soon as it’s spawned in the level. This makes sure that if it doesn’t hit anywhere within a few seconds (depending on it’s speed), say like when you are shooting at the sky, it will get destroyed automatically after a while.

In the other cases, where it hits somewhere, you can add something like this inside the projectile blueprint:

 ![28225-proj.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/d/5/dd577091c99d71b62096df76cb15ce339794ab9a.jpeg)

Doesn’t need to be overlap, you can try other types of collision as well, but it makes sure that as soon as the projectile gets in contact with some other object, it will destroy itself after spawning a hit particle effect.
