# Limited distance bullet ! !

**URL:** <https://forums.unrealengine.com/t/limited-distance-bullet/78448>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [November 16, 2016, 6:46am UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448 "2016-11-16T06:46:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_27ad1de6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_27ad1de6](https://forums.unrealengine.com/u/anonymous_user_27ad1de6)\
**Post date:** [November 16, 2016, 6:46am UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/1 "2016-11-16T06:46:18Z")

</div>

Guys,  
How to make bullets for a limited distance?

P.S. I made the bullet with projectile movement. (Side Scrolling Game)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5882066e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5882066e](https://forums.unrealengine.com/u/anonymous_user_5882066e)\
**Post date:** [November 16, 2016, 7:26am UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/2 "2016-11-16T07:26:19Z")

</div>

In the blueprint of the projectile, store the location of this actor on BeginPlay. On each calculate the projectile has travelled from that stored location and if it’s over a certain threshold, destroy the actor.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_27ad1de6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_27ad1de6](https://forums.unrealengine.com/u/anonymous_user_27ad1de6)\
**Post date:** [November 16, 2016, 7:40am UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/3 "2016-11-16T07:40:04Z")

</div>

thanks, but how do i calculate the projectile traveled?

---

<div class="post-metadata">

**Author:** ![Raildex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raildex](https://forums.unrealengine.com/u/Raildex)\
**Post date:** [November 16, 2016, 8:08am UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/4 "2016-11-16T08:08:48Z")

</div>

> [@DipranjanH;624014](#):
>
> thanks, but how do i calculate the projectile traveled?

|CurrentPosition - StartingStartingPosition|

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [November 16, 2016, 9:07am UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/5 "2016-11-16T09:07:47Z")

</div>

> [@;624022](#):
>
> |CurrentPosition - StartingStartingPosition|

Then vector length out of result from above.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_27ad1de6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_27ad1de6](https://forums.unrealengine.com/u/anonymous_user_27ad1de6)\
**Post date:** [November 16, 2016, 2:59pm UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/6 "2016-11-16T14:59:22Z")

</div>

Thank you guys, i am trying.

---

<div class="post-metadata">

**Author:** ![Raildex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raildex](https://forums.unrealengine.com/u/Raildex)\
**Post date:** [November 16, 2016, 4:44pm UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/7 "2016-11-16T16:44:25Z")

</div>

> [@;624045](#):
>
> Then vector length out of result from above.

That’s what the | are for 😛

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2a99da8f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2a99da8f](https://forums.unrealengine.com/u/anonymous_user_2a99da8f)\
**Post date:** [November 16, 2016, 5:15pm UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/8 "2016-11-16T17:15:14Z")

</div>

> [@](#):
>
> Thank you guys, i am trying.

imo just set correct initial life span… [projectile speed] \* [projectile life] = [distance traveled]

---

<div class="post-metadata">

**Author:** ![Lusiogenic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lusiogenic/32/1054664_2.png) [@Lusiogenic](https://forums.unrealengine.com/u/Lusiogenic)\
**Post date:** [November 22, 2016, 1:45pm UTC](https://forums.unrealengine.com/t/limited-distance-bullet/78448/9 "2016-11-22T13:45:04Z")

</div>

It’s good solution, but it won’t work if the bullet decelerates or accelerates.
