Hey all,
Hope everyone is having a good day. I’m trying to create a prop spawner that will randomly spawn a prop in one of three locations and i’m having issues. I’m quite new to UEFN and Verse.
I’m not the best programmer out there. Previously experience being HTML and Javascript.
This is my code for the script
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath}
using { /Verse.org/Random }
# A Verse-authored creative device that can be placed in a level
Tape_spawner := class(creative_device):
@editable
tapeProp: creative_prop = creative_prop{}
@editable
tapeAsset : creative_prop_asset = DefaultCreativePropAsset
TapeLocationDecider():void=
var RandomInt:int = GetRandomInt(1,3)
if (RandomInt = 1):
tapelocation:vector3 = vector3{X := -1084.0, Y:= 2587.999982, Z:= 3160.0}
else if(RandomInt = 2):
tapelocation:vector3 = vector3{X := 0.0, Y:= 0.0, Z:= 0.0}
else if(RandomInt = 3):
tapelocation:vector3 = vector3{X := 0.0, Y:= 0.0, Z:= 0.0}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
tapeProp.Dispose()
var spawnTapeLocation:vector3 = vector3{Translation:= tapelocation}
SpawnProp(tapeAsset,transform{Translation:= spawnTapeLocation})