I’m spawning a prop that has a niagara system (auto activate) in it when a cube hits a volume. What’s weird, is that this will sometimes work, but then when I End → Start game it breaks. Also I’ve seen it go from a broken state to a working state by changing function name.
See video - The white dot is the particle effect - First cube works as expected, then I restart the game and the particle effect no longer appears. Dropbox
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
DetectionDevice := class(creative_device):
@editable VolumeRefT1 : volume_device = volume_device{}
@editable VolumeRefT2 : volume_device = volume_device{}
@editable DeathNiagraFX : creative_prop_asset = DefaultCreativePropAsset
OnBegin<override>()<suspends>:void=
VolumeRefT1.PropEnterEvent.Subscribe(OverlapEventT1)
VolumeRefT2.PropEnterEvent.Subscribe(OverlapEventT2)
OverlapEventT1(NameOfWhatImPassingIn : creative_prop):void=
Print("T1 GOAL")
MyVFXFunction(NameOfWhatImPassingIn)
#Changed to use spawn when using Sleep in 'Reset Prop'
#spawn{ResetProp(NameOfWhatImPassingIn)}
ResetProp(NameOfWhatImPassingIn)
OverlapEventT2(NameOfWhatImPassingIn : creative_prop):void=
Print("T2 GOAL")
MyVFXFunction(NameOfWhatImPassingIn)
#spawn{ResetProp(NameOfWhatImPassingIn)}
ResetProp(NameOfWhatImPassingIn)
MyVFXFunction(PassedProp : creative_prop):void=
Print("MY VFX FUNCTION CALLED")
(PropTrans := PassedProp.GetTransform())
SpawnedPropResult := SpawnProp(DeathNiagraFX, PropTrans.Translation, PropTrans.Rotation)
#Print("spawned NiagraFX")
if (SpawnedProp := SpawnedPropResult(0)?):
Print("spawnedProp")
#the source of my problems?!
spawn{DeathNiagraFXHandleWat3(SpawnedProp)}
#Had it written like this before
#spawn:
#DeathNiagraFXHandleWat3(SpawnedProp)
ResetProp(NameOfPassTwo : creative_prop):void=
#if (NameOfPassTwo.TeleportTo[vector3{X:=0.0,Y:=0.0,Z:=10400.0}, NameOfPassTwo.GetTransform().Rotation]) {}
#Sleep(3.0)
#was 4000
if (NameOfPassTwo.TeleportTo[vector3{X:=0.0,Y:=0.0,Z:=400.0}, NameOfPassTwo.GetTransform().Rotation]) {}
#CHANGING THE FUNCTION NAME MADE PARTICLES WORK AGAIN WAT WAT WAT
DeathNiagraFXHandleWat3(NiagraFXProp : creative_prop)<suspends>:void=
Sleep(3.0)
NiagraFXProp.Dispose()
Print("despawned niagrafx")
This method of spawning a VFX has worked 100% reliably for me in other projects…