Spawning NPC when the NPC Spawner is too far from any player, the spawn doesn’t happen
At least one player needs to be close to it for the spawn to work
Please select what you are reporting on:
Creative
What Type of Bug are you experiencing?
AI
Steps to Reproduce
Position a NPC Spawner near the world origin
Create some way to verify if the NPC was spawned, either by using Verse print, teleport the NPC to the player after spawn or getting close to it)
Position a trigger to spawn the NPC somewhere very far from the world origin (not sure how far it must be yet)
Join the session alone
Interact with the trigger (The NPC will not spawn)
Expected Result
Spawn the NPC regardless there is a player close to the device or not
Observed Result
By joining the session with 2 players, and keeping one player close to the spawner device, when the other player triggers the spawn, it gonna work
It happens in the current version on UEFN session. Our published map is not facing issues (Mainly because we made a workaround keeping all the spawners below the starting point and making sure the player will not move far from it until we spawn all required npcs), only the new feature we’re creating for it.
However it always has been an issue, since we started making the first tests with NPC few months ago
Sounds like a fix was implemented for a similar issue before. Can you try to enable the new option on the NPC Character Navigation Modifier called `Always generate Navigation?’ This should help when NPCs are spawning too far away. Let us know if that helps!
Added the suggested solution as an Additional NPC Character Modifier directly into the NPC Spawner Device
Result:
Spawn still doesn’t work when there is no player close to the spawner device
The video shows the spawn (The Big pet above the button the the cat right after it) working when a new player joins the session (which is close to where the NPC spawner is)
Second test:
Added the suggested solution directly inside the NPC Character
Result:
Same as above
======================
The button that we use which triggers the spawn is at: (X=47974.831739,Y=19537.726690,Z=85.583008)
The Spawner is at: (X=-1348.298659,Y=671.624413,Z=-442.000101)
Currently we have streaming active, however the previous tests months ago, we didnt have it active, so not sure if currently it only happens with streaming on or not
Another thing that I’m not sure if changes anything in the result is that we call the Spawn() from verse and not using event binding. We can make a test if you think it can have different behavior
We have this same issue. We tested your suggested fix moments ago, but unfortunately it did not resolve the issue (just as another data point in a separate project from the tests above).
When requesting a Spawn to the device, if the NPC limit is not reached, the NPC will always spawn. The OnSpawned event was sent (up to 32.00) only when all the players in the relevancy bubble of the NPC confirmed its spawning locally on their machine. So if there was not players around, no OnSpawned event was sent - that is the issue you were seeing.
On 32.00, we have changed it to sent the event even if there is no player in the relevancy bubble at time of spawning.
Note that if you use Open World Streaming and you spawn an NPC where players are not there to stream in the level, you will have to make sure that the environment required for the NPC to behave is loaded.
Hi.
What do you mean with “you will have to make sure that the environment required for the NPC to behave is loaded.”?
That I need to have like at least a ground that is not spatially loaded below the spawner?