Summary
I have been fighting with the (SpawnAt) function on the creature_spawner_device for like a week on a project and am convinced it doesn’t work currently.
Is there anyone who has gotten this to function successfully or it just a broken feature?
# Spawn a creature at the given position. When Rotation is not provided, it will default to the Device’s rotation.
# Returns the agent spawned or false if the device has reached its maximum spawn count.
# This function is ‘<suspends>’ because it takes time to load the creature before it can be returned.
SpawnAt<public>(Position:(/Verse.org/SpatialMath:)vector3, ?Rotation:?(/Verse.org/SpatialMath:)rotation = external {})<suspends>:?agent = external {}
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
Use this snippet here and step on the trigger.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/SpatialMath }
using { /UnrealEngine.com/Temporary/Diagnostics }
fiend_spawner := class(creative_device):
@editable
SpawnTrigger : trigger_device = trigger_device{}
@editable
CreatureSpawner : creature_spawner_device = creature_spawner_device{}
@editable
TestSpawnLocation : vector3 = vector3{Forward := 0.0, Left := 0.0, Up := 0.0}
OnBegin<override>()<suspends>:void=
SpawnTrigger.TriggeredEvent.Subscribe(OnSpawnTrigger)
OnSpawnTrigger(TriggeringAgent : ?agent):void=
spawn{SpawnCreatureAtTestLocation()}
SpawnCreatureAtTestLocation()<suspends>:void=
MaybeSpawnedCreature := CreatureSpawner.SpawnAt(TestSpawnLocation)
if (SpawnedCreature := MaybeSpawnedCreature?):
Print("Spawned creature at Forward={TestSpawnLocation.Forward}, Left={TestSpawnLocation.Left}, Up={TestSpawnLocation.Up}")
else:
Print("SpawnAt failed. Check your spawner settings or active spawn limit.")
Expected Result
Creature should spawn where told to.
Observed Result
Nothing spawns.
Platform(s)
All