# How to properly calculate the vector at the end of a beam emitter?

**URL:** <https://forums.unrealengine.com/t/how-to-properly-calculate-the-vector-at-the-end-of-a-beam-emitter/267381>\
**Category:** FX\
**Tags:** unreal-engine, UE4-26, question\
**Created:** [December 20, 2021, 6:04pm UTC](https://forums.unrealengine.com/t/how-to-properly-calculate-the-vector-at-the-end-of-a-beam-emitter/267381 "2021-12-20T18:04:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thehotterpotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thehotterpotato](https://forums.unrealengine.com/u/thehotterpotato)\
**Post date:** [December 20, 2021, 6:04pm UTC](https://forums.unrealengine.com/t/how-to-properly-calculate-the-vector-at-the-end-of-a-beam-emitter/267381/1 "2021-12-20T18:04:56Z")

</div>

Hello folks!

I am am trying to spawn a directional burst at the end of a beam emitter. This is my current setup for getting the position of the last two particles in the beam and getting the direction between them.

However this setup is not working at all and I’m not really sure why. Does anyone have any helpful insights, perhaps there is a much easier way I am missing?

Thanks so much in advance!

 ![scratchpad](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/f/ef7588428f34cadf15aa39d0e435ad456f3a00a1.png)

---

<div class="post-metadata">

**Author:** ![presto423](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@presto423](https://forums.unrealengine.com/u/presto423)\
**Post date:** [December 20, 2021, 7:00pm UTC](https://forums.unrealengine.com/t/how-to-properly-calculate-the-vector-at-the-end-of-a-beam-emitter/267381/2 "2021-12-20T19:00:08Z")

</div>

You may have to start with the directional vectors of the beam’s particles based on their indices. How you’re doing it is calculating position, and trying to infer direction from the difference between positions, which looks like it should work. So, instead of Position set in the previous and next index values, try get direction or set direction for each of those. Then subtract and multiply if necessary, and get direction again before plugging into the EndParticles Map Set node.

---

<div class="post-metadata">

**Author:** ![thehotterpotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thehotterpotato](https://forums.unrealengine.com/u/thehotterpotato)\
**Post date:** [December 20, 2021, 7:05pm UTC](https://forums.unrealengine.com/t/how-to-properly-calculate-the-vector-at-the-end-of-a-beam-emitter/267381/3 "2021-12-20T19:05:06Z")

</div>

How do I get a specific particles direction? It’s not an attribute I can read

---

<div class="post-metadata">

**Author:** ![presto423](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@presto423](https://forums.unrealengine.com/u/presto423)\
**Post date:** [December 20, 2021, 7:23pm UTC](https://forums.unrealengine.com/t/how-to-properly-calculate-the-vector-at-the-end-of-a-beam-emitter/267381/4 "2021-12-20T19:23:12Z")

</div>

You need to create / set it in the Niagara emitter. And/Or, it may be doable in BP for your beam emitter with this:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/1/b/e1b0aec2da7aaeb626a4bdc0881292da7bdb20d1.jpeg "How To Use The New Calculate Direction Node - Unreal Engine 4 Tutorial") ](https://www.youtube.com/watch?v=nrpbwe8AlqQ)
