# Camera on wrong target when using Spawn AI from Class (Third Person Character)

**URL:** <https://forums.unrealengine.com/t/camera-on-wrong-target-when-using-spawn-ai-from-class-third-person-character/472511>\
**Category:** Cinematics & Media\
**Tags:** spawn, unreal-engine, follow, question\
**Created:** [October 6, 2020, 7:42pm UTC](https://forums.unrealengine.com/t/camera-on-wrong-target-when-using-spawn-ai-from-class-third-person-character/472511 "2020-10-06T19:42:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uproar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Uproar](https://forums.unrealengine.com/u/Uproar)\
**Post date:** [October 6, 2020, 7:42pm UTC](https://forums.unrealengine.com/t/camera-on-wrong-target-when-using-spawn-ai-from-class-third-person-character/472511/1 "2020-10-06T19:42:07Z")

</div>

Please help solve-- repeat problem for the AI-confused confused (me). Happens in every project; Something I am not getting here so created a clean build with lots of pictures; I seem unable to solve this one.

First picture is the basic setup – I’ve created an actor blueprint that I wish to spawn a third person character; perform a Move To Location operation on that character; and have the camera follow the spawn (if only it would); seems I can either have the camera behind the spawn; or I can have an AIController; I can’t seem to have both (error checking reports AI Controller Invalid – see blueprint). Only way I can seem to get the camera behind the spawn is if I go to blueprint for ThirdPersonCharacter and select auto-possess, but that breaks my ability to get the AI controller.

I should note that I am seeing double of everything – thus I added the DoOnce statement – no help there; I also tried using index of 1 in each of the gets from the getallactorsofclass statements; anything but 0 fails.

I’ve tried possess; unpossess; and even set viewport target with blend. In many combinations; Still lost.

---

<div class="post-metadata">

**Author:** ![Uproar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Uproar](https://forums.unrealengine.com/u/Uproar)\
**Post date:** [October 6, 2020, 7:43pm UTC](https://forums.unrealengine.com/t/camera-on-wrong-target-when-using-spawn-ai-from-class-third-person-character/472511/2 "2020-10-06T19:43:07Z")

</div>

alt text

 ![317531-movetolocationcomplete-note-two-ai-controllers.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/b/ffba4e95df8ff7646b03468c3b64971c887a1b9d.jpeg)

---

<div class="post-metadata">

**Author:** ![Uproar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Uproar](https://forums.unrealengine.com/u/Uproar)\
**Post date:** [October 6, 2020, 9:33pm UTC](https://forums.unrealengine.com/t/camera-on-wrong-target-when-using-spawn-ai-from-class-third-person-character/472511/3 "2020-10-06T21:33:14Z")

</div>

Okay I basically solved this; will paste the solution blueprint for others that might need it. If you look carefully at the SetViewTargetWithBlend you will notice I referenced the playercontroller; even though I have no use for it. I plan to use the ai spawned character instead; I rationalized this as setting the player’s viewport – not setting the controller to that viewport. Makes some sense from that POV.

Anyways, I am still getting a double spawn that I can’t explain, but hoping that is an artifact of the starting package that I do not quite understand – will try it back in my real project and will hope it does not remain an issue. So marking this as solved for now.

 ![317555-solution-blueprint.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/8/a48c5e0a98b09707498216a16680dd1449a2f3f9.jpeg)
