I am trying to create a little game mode using UEFN where waves a fiends attack the player’s base. I want to use the fiends and not the other AI characters. So I placed a creature spawner to spawn the fiends. the problem is it seems like the spawner is too far away and the fiends just stand there until I walk closer. Is there any way to increase their agro distance?
You can see in the screenshot that I am not super far from the spawner. I tried to use verse to try to programmatically move the fiends, here is the code:
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Fortnite.com/AI }
using { /Verse.org/Simulation }
using { /Verse.org/Random }
using { /UnrealEngine.com/Temporary/Diagnostics }
# See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.
# A Verse-authored creative device that can be placed in a level
fiend_manager := class(creative_device):
@editable TeamOneFiendSpawners : []creature_spawner_device = array{}
@editable TeamTwoFiendSpawners : []creature_spawner_device = array{}
@editable TeamThreeFiendSpawners : []creature_spawner_device = array{}
@editable TeamFourFiendSpawners : []creature_spawner_device = array{}
@editable TeamOneObjective : objective_device = objective_device{}
@editable TeamTwoObjective : objective_device = objective_device{}
@editable TeamThreeObjective : objective_device = objective_device{}
@editable TeamFourObjective : objective_device = objective_device{}
OnBegin<override>()<suspends>:void=
# Subscribes all spawners spawn events
for (X := 0..TeamOneFiendSpawners.Length -1):
if (Spawner := TeamOneFiendSpawners[X]):
Spawner.SpawnedEvent.Subscribe(FiendSpawned);
FiendSpawned(Agent: agent):void=
# Grabbing the agent from the Spawned Event and grabbing the associated fort_character
if (Fiend := Agent.GetFortCharacter[]):
# Set their target to be the defense objective
Print("Fiend Spawned");
NavigationTarget:navigation_target = MakeNavigationTarget(TeamOneObjective.GetTransform().Translation)
if(FiendNavigatable := Fiend.GetNavigatable[]):
Print("Navigating Fiend to target");
spawn{NavigateToTarget(FiendNavigatable, NavigationTarget)}
NavigateToTarget(Navigatable:navigatable, NavigationTarget:navigation_target)<suspends>:void=
# The radius in cm the AI agent should start following from.
Radius:float = 40.0
Navigatable.NavigateTo(NavigationTarget, ?ReachRadius := Radius)
The issue I ran into with this approach is the Fiend doesn’t seem to implement the navigatable interface:
if(FiendNavigatable := Fiend.GetNavigatable[]):
execution doesn’t get ever get past this if statement. I am open to any ideas or suggestions