# How do I make this code better, it currently is a 360 aiming system for a 2.5d sidescroller, but dosnt work correctly

**URL:** <https://forums.unrealengine.com/t/how-do-i-make-this-code-better-it-currently-is-a-360-aiming-system-for-a-2-5d-sidescroller-but-dosnt-work-correctly/2705142>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [March 10, 2026, 5:43pm UTC](https://forums.unrealengine.com/t/how-do-i-make-this-code-better-it-currently-is-a-360-aiming-system-for-a-2-5d-sidescroller-but-dosnt-work-correctly/2705142 "2026-03-10T17:43:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoody469](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hoody469](https://forums.unrealengine.com/u/hoody469)\
**Post date:** [March 10, 2026, 5:43pm UTC](https://forums.unrealengine.com/t/how-do-i-make-this-code-better-it-currently-is-a-360-aiming-system-for-a-2-5d-sidescroller-but-dosnt-work-correctly/2705142/1 "2026-03-10T17:43:19Z")

</div>

![image_2026-03-10_174156906](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/a/c8a8f26f2c7f86da31385b5c9714a48473c01814.png)

Current blueprint

---

<div class="post-metadata">

**Author:** ![illspiritx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@illspiritx](https://forums.unrealengine.com/u/illspiritx)\
**Post date:** [March 12, 2026, 12:25am UTC](https://forums.unrealengine.com/t/how-do-i-make-this-code-better-it-currently-is-a-360-aiming-system-for-a-2-5d-sidescroller-but-dosnt-work-correctly/2705142/2 "2026-03-12T00:25:37Z")

</div>

I did 2.5Daiming like so, first the input:

 ![AimInput](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/f/ecf4d02f1099913d593c27370ea770c80b79a001.jpeg)

Top half of comment box is teh thumbstick stuff:

Then updating direction floats in a function in tick:

 ![AimMath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/4/22405c5bb7846390ca4e32a81395debf5a17177b.jpeg)

The +40z bits there are just to raise the origin to shoulder-ish level.

Is a bit of a roundabout way to do it, but I split off the input like that so mouse or gamepad would work, and so NPCs could just use their focused actor to set the target loc.

There’s a bit more after the wire going offscreen where I extract the aim pitch for the aimoffset in the anim bp. Is a bit wonky tho lol.
