# How to calculate next transform location based off distance?

**URL:** <https://forums.unrealengine.com/t/how-to-calculate-next-transform-location-based-off-distance/555761>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, question, Blueprint\
**Created:** [May 12, 2022, 7:04pm UTC](https://forums.unrealengine.com/t/how-to-calculate-next-transform-location-based-off-distance/555761 "2022-05-12T19:04:07Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Krileon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Krileon](https://forums.unrealengine.com/u/Krileon)\
**Post date:** [May 12, 2022, 8:52pm UTC](https://forums.unrealengine.com/t/how-to-calculate-next-transform-location-based-off-distance/555761/4 "2022-05-12T20:52:31Z")

</div>

Basically when generating bullets you add the current actor transform or wherever the bullet is shooting from transform to an array. Then in the Tick for your BP you loop that array then perform a trace between where the bullet started and where it should then be to handle your collision behavior. The math for finding the new location is in the blog under “Moving the bullets” section. If the bullet hit something remove it from the array. If it didn’t hit anything then update the array with its new location (the end point of your trace).

This is basically a continuation of my below topic.

> [@Niagara Collision to Apply Gameplay Effect?](https://forums.unrealengine.com/t/niagara-collision-to-apply-gameplay-effect/552151/10):
>
> I’ve no idea where to even begin to doing that. Is there any tutorials available? I’m not expecting thousands of projectiles on screen. Probably anywhere from 200-300 realistically. I’d love to, but the documentation for Mass is basically non-existing. It’s still marked experimental and doesn’t seam viable for anything other than AI crowds right now.

Honestly I’m still not all that impressed. A staff member said my original Niagara implementation is bad performance, but honestly it was the best performance of all 3 things I’ve tried. I’ve tried Niagara, Object Pooling, and now this usage. Niagara still performed better.

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-calculate-next-transform-location-based-off-distance/555761)._
