# AI works, unless level streamed

**URL:** <https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571>\
**Category:** AI\
**Tags:** UE4-8, unreal-engine, question, Blueprint\
**Created:** [July 17, 2015, 2:16am UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571 "2015-07-17T02:16:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paladinsl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paladinsl](https://forums.unrealengine.com/u/Paladinsl)\
**Post date:** [July 17, 2015, 2:16am UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/1 "2015-07-17T02:16:56Z")

</div>

I have an AI setup in my level that engages some randomly spawning targets, when I load the map directly in the editor and play, it runs perfectly, but when it’s loaded during the course of the level it does not, it just sits there no matter what I do, if there some simple setting I am missing somewhere?

---

<div class="post-metadata">

**Author:** ![Havoc47c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Havoc47c](https://forums.unrealengine.com/u/Havoc47c)\
**Post date:** [August 24, 2015, 8:50pm UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/2 "2015-08-24T20:50:09Z")

</div>

I am having a similar issue with the AI perception system. When I stream a level, actors in the streamed level no longer perceive each other. But when everything is in the persistent level, everything works fine. This needs some attention. Did you ever find a solution?

---

<div class="post-metadata">

**Author:** ![Paladinsl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paladinsl](https://forums.unrealengine.com/u/Paladinsl)\
**Post date:** [August 25, 2015, 3:26am UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/3 "2015-08-25T03:26:08Z")

</div>

Not as of yet, no. I kind of moved the team on to other parts of the project and pushed AI down the list until someone came back with something here.

---

<div class="post-metadata">

**Author:** ![Paladinsl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paladinsl](https://forums.unrealengine.com/u/Paladinsl)\
**Post date:** [September 26, 2015, 10:15am UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/4 "2015-09-26T10:15:01Z")

</div>

Still an issue, tried more solutions than I can shake a stick at, nothing seems to work.

AI functions perfectly when the level is loaded independently, but when loaded off the persistent level during the course of the game, nothing at all, the AI doesn’t even try. It’s not a Navmesh thing, it doesn’t even make the attempt to load.

---

<div class="post-metadata">

**Author:** ![unit23](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/unit23/32/1223962_2.png) [@unit23](https://forums.unrealengine.com/u/unit23)\
**Post date:** [November 3, 2015, 12:06am UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/5 "2015-11-03T00:06:21Z")

</div>

This appears to be still an issue…

4.9.2

---

<div class="post-metadata">

**Author:** ![Envis10n](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Envis10n](https://forums.unrealengine.com/u/Envis10n)\
**Post date:** [November 3, 2015, 12:52am UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/6 "2015-11-03T00:52:26Z")

</div>

I’m not sure if there are any planned fixes for this, but it does appear to be an issue. I have gone ahead and used a workaround for this: a collision sphere. This is a fix specific to sight perception, but it is working fine on a streamed map.

 ![65329-aihelp1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/8/398933dd5cca345a617c0591b55195bbc64a45f8.png)

![65330-aihelp2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/6/d661f23f49c65cd8b55e7c5552baabb2c6262899.png)

In order to stop them from seeing behind them, I also check for rotation.

![65331-aihelp3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/c/e7c37943b570eea0d2b4c615a02180abcbba5c24.png)

This gets the current AI rotation with the look-at rotation to the target, gets the delta, splits out Yaw, and checks if it is greater than 90 degrees, or less than -90 degrees (180 degrees of sight).

Certainly a workaround, and I would love to see a real fix in place for AI perception using streamed levels. Hopefully this helps.

---

<div class="post-metadata">

**Author:** ![XADIFY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XADIFY](https://forums.unrealengine.com/u/XADIFY)\
**Post date:** [October 1, 2016, 1:21pm UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/7 "2016-10-01T13:21:39Z")

</div>

I encountered the same problem. Got any update on it?

---

<div class="post-metadata">

**Author:** ![Zcience](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zcience/32/951950_2.png) [@Zcience](https://forums.unrealengine.com/u/Zcience)\
**Post date:** [October 3, 2016, 1:51pm UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/8 "2016-10-03T13:51:02Z")

</div>

Hey there,

you can can make the AIPerception work again, if you specifically register Actors with [“Register Perception Stimuli Source”](https://docs.unrealengine.com/latest/INT/BlueprintAPI/AI/Perception/RegisterPerceptionStimuliSource/index.html).

For Example: I wanted my AI to see my player → In “Begin Play” I registered the player as perception stimuli source for the AISense class Seeing.

I guess that at the start of a level, the AIPerception system iterates through all actors and registers them as stimuli sources. If you stream a level after that, the loaded actors don’t get automatically registered → you have to register them manually…

I hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![XADIFY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XADIFY](https://forums.unrealengine.com/u/XADIFY)\
**Post date:** [October 3, 2016, 4:12pm UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/9 "2016-10-03T16:12:17Z")

</div>

I didn’t try that … unfortunately I had to skip the idea of level streaming cuz m having all sorts of issues … my player pawn doesn’t get possessed(even when auto possess is set correctly), player start stopped working, If things got working in editor, something gets messed up while launching on phone. I’m making my 1st android game (all BP) n having hard time dodging these problems. Even after making sure have done things correctly. bugs jus appear from no where !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_84739bff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_84739bff](https://forums.unrealengine.com/u/anonymous_user_84739bff)\
**Post date:** [November 28, 2016, 8:15pm UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/10 "2016-11-28T20:15:03Z")

</div>

I’m seeing this issue as well. Can we get some answers on how to deal with this?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_84739bff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_84739bff](https://forums.unrealengine.com/u/anonymous_user_84739bff)\
**Post date:** [November 28, 2016, 8:19pm UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/11 "2016-11-28T20:19:07Z")

</div>

This works for me. An ugly workaround, but it works!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_84739bff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_84739bff](https://forums.unrealengine.com/u/anonymous_user_84739bff)\
**Post date:** [November 28, 2016, 8:20pm UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/12 "2016-11-28T20:20:45Z")

</div>

It seems that the answer is what Zcience said. I’ll go ahead and post a feature request in the forums.

> Hey there,
> 
> you can can make the AIPerception work  
> again, if you specifically register  
> Actors with “Register Perception  
> Stimuli Source”.
> 
> For Example: I wanted my AI to see my  
> player → In “Begin Play” I  
> registered the player as perception  
> stimuli source for the AISense class  
> Seeing.
> 
> I guess that at the start of a level,  
> the AIPerception system iterates  
> through all actors and registers them  
> as stimuli sources. If you stream a  
> level after that, the loaded actors  
> don’t get automatically registered →   
> you have to register them manually…
> 
> I hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![Jenkins\_Gage](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jenkins_gage/32/677675_2.png) [@Jenkins\_Gage](https://forums.unrealengine.com/u/Jenkins_Gage)\
**Post date:** [October 14, 2022, 7:33am UTC](https://forums.unrealengine.com/t/ai-works-unless-level-streamed/325571/13 "2022-10-14T07:33:19Z")

</div>

For anyone if you encountered the same problem, just try to check AIPerceptionStimuliSource-\>AI Perception-\>Auto Register As Source  
I think this is an automatic way to do what Zcience said and this solved my problem.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/a/f/5affd5c44b1d9b44c110bd5a4428454aa037b8cd.png)
