Tutorial: Working with NPC Spawner and Animation Preset

Using the NPC Spawner to spawn a custom character and play a looping animation through an Animation Preset.

https://dev.epicgames.com/community/learning/tutorials/vaqW/fortnite-working-with-npc-spawner-and-animation-preset

Very good informative video! Congratulations!

1 Like

Unfortunately this is as far as you can get with custom npcs. They cannot get playspace or players nor get a device to be able to get playspace. So targeting players is null til they allow us to do so again. I have tried soooo many different ways and workarounds but nothing works.

I’m using a device in conjunction with the npc_behavior script to act as the manager for the NPCs.

  1. The device has an editable for a volume_device.
  2. The volume detects players entering/leaving the area with the NPCs.
  3. When a player enters the volume, the manager device adds the player to an array within the npc_behavior.
  4. The npc_behavior now has the players it needs to worry about.

I came to this method using the AI Assistant. I have found issues with the code generated by the AI Assistant, but the conceptual stuff seems to be pretty decent. Sometimes the AI will suggest using things that don’t exist in UEFN so you should still be warry.

I too have been tinkering with the assistant. You are right. Sometimes it will suggest things that would work with other languages but not with verse. I did find a method as well with a separate device. It listens for a player spawned event then adds it to a array. Then it listens for a npc spawned event and then accesses the npc script from it’s agent, then copies the array to the npc’s array. The npc then uses the array to do the calculations to find a specific player.