There is now the ability to spawn and destroy props at runtime using Verse! Here is a quick example of a script spawning a prop, waiting 1 second, then destroying the prop:
using { /Fortnite.com/Devices }
using { /Verse.org/Native }
using { /Verse.org/Simulation }
using { /Verse.org/Random }
using { /EpicGames.com/Temporary/Diagnostics }
using { /EpicGames.com/Temporary/SpatialMath }
log_prop_spawner_device := class(log_channel){}
prop_spawner_device := class(creative_device):
Logger:log = log{Channel:=log_prop_spawner_device}
# Reference to a single creative_prop_asset
@editable
var ChairProp:creative_prop_asset := DefaultCreativePropAsset
# Reference to a creative_prop_asset array
@editable
var ChairProps:[]creative_prop_asset := array{}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
Sleep (3.0)
SpawnChairProps()
# Spawn and destroy chair props
SpawnChairProps()<suspends>:void=
SpawnPosition:vector3 := vector3{X:=0.0, Y:=-700.0, Z:= 0.0}
for ( Prop : ChairProps):
SpawnedProp := SpawnProp(Prop, SpawnPosition, IdentityRotation())
Sleep(1.0)
if (CreativeProp := SpawnedProp(0)?):
CreativeProp.Dispose()
Oh wow this is awesome! I’ve been looking forward to this feature for a while, thanks for adding it! Does this work with custom Building Props made with imported or modeled assets, or is it only for Fortnite props at the moment?
Also would you be willing to add this script to the Snippets library? I think people would appreciate finding it there.
No problem! It’s still new so there’s not much there but I hope to see more snippets soon! This reminds me I have to update my Day/Night Cycle snippet. I wrote it before Verse supported the Skydome Device so I had written a bunch of comments in it being like “pretend you can use the Skydome Device”. I want to add more snippets when I get a chance.
Yes, you can spawn up to 100 (Maybe now 300/500/1000) per creative_device using the same prop asset, or different ones. Just using the same code as posted above
Thank you for this example! I wasn’t finding very good resources on how to manage an array with creative_prop and this got be going. Much appreciated!