# Bug: SetFocalPoint doesn't update controller pitch rotation

**URL:** <https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321>\
**Category:** AI\
**Tags:** look-at, ai-controller, unreal-engine, bug-report, Blueprint, question\
**Created:** [June 28, 2016, 7:21pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321 "2016-06-28T19:21:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xukapy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xukapy](https://forums.unrealengine.com/u/Xukapy)\
**Post date:** [June 28, 2016, 7:21pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/1 "2016-06-28T19:21:38Z")

</div>

\*\*Hello, I found two ways to make AI look at me: SetFocus and SetFocalPoint \*\*

**I use SetFocus once on Begin Play and it works fine**

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

**AI focusing on Pivot Point of my Character and update Yaw and Pitch control rotations (Red arrow represents Controller Rotation)**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/0/5092db5b4b4d0e459765486481df1a24b2bf764b.png)

**Hoever, I need him to look at my eyes and not at Origin Point so I tried to use SetFocalPoint that I update every tick**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/f/bf1ebdcf580574c488c1fc02da534d6ba10b4bec.png)

**By that way AI Controller only updates Yaw rotation and doesnt seem to set Pitch.**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/f/d/fdcbd222336616f95b9f36a23ea73175d3b496d0.png)

**So I have 2 questions:**

**1. Is it bug?**

**2. If not, tell me please the right way to make AI look at my eyes (component in my Character or something like that)**

---

<div class="post-metadata">

**Author:** ![Xukapy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xukapy](https://forums.unrealengine.com/u/Xukapy)\
**Post date:** [June 28, 2016, 7:29pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/2 "2016-06-28T19:29:48Z")

</div>

If you may think I added +0,0,50 vector by using SetFocalPoint and thats why control rotation points forward. Answer - no, it doesnt update Pitch rotation in any way (jumping, going more down, etc)

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [June 29, 2016, 4:00pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/3 "2016-06-29T16:00:05Z")

</div>

Hey Xukapy,

Have you tried dragging off of your player pawn reference and using the Get Actor Eyes View Point node to set the Focal Point? Let me know if that makes a difference.

I’m testing this issue in the meantime.

---

<div class="post-metadata">

**Author:** ![Xukapy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xukapy](https://forums.unrealengine.com/u/Xukapy)\
**Post date:** [June 29, 2016, 4:10pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/4 "2016-06-29T16:10:59Z")

</div>

Hey

Just tried - no difference. Still SetFocalPoint only updates Yaw.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [June 29, 2016, 5:13pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/5 "2016-06-29T17:13:01Z")

</div>

I have not been able to reproduce this issue on my end in a clean project. Would you be able to zip up your project, upload it to dropbox, and provide a link so that I can take a closer look at your setup? You can PM me the link on the forums: [https://forums.unrealengine.com/member.php?160394--Flint](https://forums.unrealengine.com/member.php?160394--Flint)

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [June 29, 2016, 8:34pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/6 "2016-06-29T20:34:03Z")

</div>

After looking at your project, it appears that Set Focal Point is working as intended. The reason is if you notice, you’re passing in a vector value, which means that the rotation would not change. Set Focus takes in the entire actor reference, which includes the entire transform of that actor.

What you can do is use Find Look at Rotation between the two actors, and then use that to set the rotation of your gun and any other parts of your AI character that you’d like to have looking/pointing at your player character.

Give that a shot and let me know if it works out for you.

Have a great day

---

<div class="post-metadata">

**Author:** ![Xukapy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xukapy](https://forums.unrealengine.com/u/Xukapy)\
**Post date:** [June 29, 2016, 9:08pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/7 "2016-06-29T21:08:38Z")

</div>

Thanks for answer,

I’m passing vector value because it expects vector value.

In this situation Rotation and Scale of my Character doesn’t ever affect location in which, I expect, SetfocalPoint should find LookAt rotation. Plus he finds LookAt rotation but updates only Yaw.

Then could you explain me please what SetFocalPoint is used for and how it works.

I guess I can try to use SetControlRotation, don’t know if it will be working.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [July 5, 2016, 8:22pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/8 "2016-07-05T20:22:26Z")

</div>

Have you tested SetControlRotation in your project? Were you able to get the results that you were looking for?

---

<div class="post-metadata">

**Author:** ![Xukapy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xukapy](https://forums.unrealengine.com/u/Xukapy)\
**Post date:** [July 5, 2016, 11:19pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/9 "2016-07-05T23:19:53Z")

</div>

Hi, yes I tried and it doesn’t work this way.

SetControlRotation overrided every tick by internal code.  
Also your colleague Mieszko said in [THIS](https://answers.unrealengine.com/questions/169885/usecontrollerdesiredrotation-broken-in-47.html) thread: “we don’t recommend micro-controlling AI. If you want your AI to look at a specific location you set its focus”

So you give me 2 options:

SetFocus - where I need to send actor and it looks at its Pivot Point (Updating Yaw and Pitch) but not being able to set custom location

OR

SetFocalPoint - where I can set custom location but it only updates Yaw control rotation and not affect Pitch.

I’m 99.9% that LookAtRotation broke somewhere in SetFocalPoint. I don’t believe that you find LookAtRot, update Yaw and then just kill Pitch for no reason.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [July 7, 2016, 2:46pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/10 "2016-07-07T14:46:47Z")

</div>

After additional testing, I have entered a bug report for this issue, UE-32894, to be investigated by our developers. Thank you for your report.

Have a great day

---

<div class="post-metadata">

**Author:** ![spacebares](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spacebares](https://forums.unrealengine.com/u/spacebares)\
**Post date:** [March 15, 2017, 6:39am UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/11 "2017-03-15T06:39:03Z")

</div>

any news on this?

---

<div class="post-metadata">

**Author:** ![Xukapy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xukapy](https://forums.unrealengine.com/u/Xukapy)\
**Post date:** [March 15, 2017, 11:18am UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/12 "2017-03-15T11:18:41Z")

</div>

You can enter bug number at [issues.unrealengine.com](http://issues.unrealengine.com). its still unresolved. Better create own lookat function than use this broken SetFocalPoint

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [March 15, 2017, 1:31pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/13 "2017-03-15T13:31:51Z")

</div>

Hey marineuac,

Here is a link to the issue on our public tracker:

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-32894)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

Have a great day

---

<div class="post-metadata">

**Author:** ![Jeslas\_Pravin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jeslas\_Pravin](https://forums.unrealengine.com/u/Jeslas_Pravin)\
**Post date:** [July 23, 2017, 12:38pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/14 "2017-07-23T12:38:43Z")

</div>

This is not a bug i think, the pitch is zeroed in function

```
/** Update direction AI is looking based on FocalPoint */
virtual void UpdateControlRotation(float DeltaTime, bool bUpdatePawn = true);

```

of AIController  
In function Impl you can see the following part of code,You can comment it and recompile the engine or you can override the function in you custom controller and remove the below code alone

```
// Don't pitch view unless looking at another pawn
	if (NewControlRotation.Pitch != 0 && Cast<APawn>(GetFocusActor()) == nullptr)
	{
		NewControlRotation.Pitch = 0.f;
	}

```

I did second option and it worked well… 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [December 8, 2017, 2:06am UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/15 "2017-12-08T02:06:44Z")

</div>

Hey ,

Looks like this is still a bug but it has been removed from the issues tracker. The problem lies in the code that Jeslas Pravin references below. That logic will always zero-out the pitch when there isn’t an actor being focused. Since using the location over the actor is precisely so we can control the pitch, this has to be faulty logic. It’s the exact opposite of what we need. Plus, if I override that function, copy it from AAIController, and comment-out that block, the pitch works as desired. Cheers!

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [December 8, 2017, 2:47pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/16 "2017-12-08T14:47:18Z")

</div>

Hey Jin\_VE,

The reason the issue is no longer available is because it is actually a feature request (which we have removed from the bug tracker to narrow the focus of it strictly to bug reports). As Jeslas Pravin posted, the pitch is zeroed out if the focus actor is not a pawn. The behavior should be configurable, and it sounds like you’ve got a method of accomplishing this. Thanks for sharing.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [December 8, 2017, 2:52pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/17 "2017-12-08T14:52:18Z")

</div>

But when you set the focal point, you can’t provide a pawn so there’s no way to avoid zeroing out the pitch – other than overriding the update function. So if it’s a feature then it’s incomplete IMO, but OK.

---

<div class="post-metadata">

**Author:** ![crossmr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@crossmr](https://forums.unrealengine.com/u/crossmr)\
**Post date:** [September 22, 2018, 1:36pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/18 "2018-09-22T13:36:35Z")

</div>

I would have to agree with here. We’re left in a position of either targeting someone’s waist, or having to write a custom function to handle this. I guess there are maybe some scenarios where you wouldn’t want to the AI to adjust their pitch, but if you’re giving them a target to either fire or look at something, why wouldn’t you want them to adjust their pitch so that they’re actually targeting that thing?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [September 22, 2018, 4:36pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/19 "2018-09-22T16:36:15Z")

</div>

Heya, here is what I did to get around this.

You will need to use a C++ project or convert yours over to C++.

![254435-updateroth.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/a/1/da1682e20e58952c1d279260ff838dc530479860.png)

 ![254436-updaterot.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/e/1eec4a13472d143ee1ec049bd0b0c15ba6885332.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [September 22, 2018, 4:52pm UTC](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321/20 "2018-09-22T16:52:29Z")

</div>

I love Unreal and I don’t mean to sound ungrateful. It’s just that there are a LOT of these fundamental bugs that are keeping us from doing great things while you guys keep adding new features (with more bugs).

Yes, we can implement this fix ourselves, but it forces everyone to use a C++ project. And isn’t the goal of providing UE4 to reduce our burden as we bring our creativity into form? There are major roadblocks in so many systems that keep us from doing new and amazing things without major consternation (to get around or fix years-old bugs). IMO, it’s antithetical to your mission, and for us it means an eternal state of frustration and confusion with a nice helping of despair. All the time. Docs are almost non-existent and advanced questions on AnswerHub sit unanswered. I’d say one in ten of my issues is addressed anywhere online. It’s really, really, lonely out here sometimes.

Again, this comes from a place of love. I’m not looking for a reply, I just wanted to express my feelings. Please consider using some of that sweet sweet Fortnite money on going through the backlog.  
Cheers!

[Next page](https://forums.unrealengine.com/t/bug-setfocalpoint-doesnt-update-controller-pitch-rotation/362321.md?page=2)
