# How to auto aim a weapon at a world point

**URL:** <https://forums.unrealengine.com/t/how-to-auto-aim-a-weapon-at-a-world-point/473769>\
**Category:** Character & Animation\
**Tags:** aim, unreal-engine, question\
**Created:** [October 31, 2020, 2:05am UTC](https://forums.unrealengine.com/t/how-to-auto-aim-a-weapon-at-a-world-point/473769 "2020-10-31T02:05:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan87](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan87](https://forums.unrealengine.com/u/Ryan87)\
**Post date:** [October 31, 2020, 2:05am UTC](https://forums.unrealengine.com/t/how-to-auto-aim-a-weapon-at-a-world-point/473769/1 "2020-10-31T02:05:17Z")

</div>

So in my game the character can select a target by clicking on an actor. The actor implements a “targetable” interface that will return its aim point on request. When the player clicks the actor and gets the aim point I can calculate the “look at rotation” from my character’s muzzle socket to the target actor. I observe my socket’s rotation and realize that once my socket’s rotation is the same (pitch/yaw) as the look at rotation then I can fire a projectile and hit the target.

I wish to have the character, via the animation blueprint, automatically point the weapon at the target if valid. I already have an aim offset and I can feed in pitch and yaw manually to the aim offset to get the rotations aligned. I cannot figure out how to do this automatically. I think the challenge comes in the fact that each time I adjust the aim pitch/yaw it changes the location of the muzzle socket slightly which also changes the look at rotation and the socket rotation.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 31, 2020, 1:10pm UTC](https://forums.unrealengine.com/t/how-to-auto-aim-a-weapon-at-a-world-point/473769/2 "2020-10-31T13:10:18Z")

</div>

I think you need to do the ‘look at’ from the back of the weapon, not the muzzle, because you’re misaligning the muzzle that way.

---

<div class="post-metadata">

**Author:** ![Ryan87](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan87](https://forums.unrealengine.com/u/Ryan87)\
**Post date:** [November 2, 2020, 1:19am UTC](https://forums.unrealengine.com/t/how-to-auto-aim-a-weapon-at-a-world-point/473769/3 "2020-11-02T01:19:06Z")

</div>

thanks ill give it a shot
