I think the SpawnProp and MoveTo calls you can do with Fortnite props through verse are really cool, but either it’s not possible or I was unable to figure out how you can get the position of an asset in the world. I wanted to be able to have a Fortnite asset being moved through verse using the MoveTo call and be able to read it’s current position as it’s moving but I couldn’t find anything that would be able to let me do that. The closest thing I found was being able to read the position of the Verse Console Creative device which I can use as a vector3 in the code, but I want to be able to grab the vector3 of the Fortnite asset I was moving. So unless I create a lot of annoying extra scripts/consoles that all just read their current location and are childed under the asset I’m moving I don’t know another way of doing such. Any help or insight on this would be amazing, or this can just be labeled as a feature request.
You can use GetTransform()
on the creative_prop you spawned. Here is an example:
using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/CreativeAnimation }
using { /Verse.org/Native }
using { /Verse.org/Simulation }
using { /EpicGames.com/Temporary/Diagnostics }
using { /EpicGames.com/Temporary/SpatialMath }
hello_world_device := class(creative_device):
@editable
CreativeProp: creative_prop_asset := DefaultCreativePropAsset
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
SpawnedProp := SpawnProp(CreativeProp, vector3{X:=0.0, Y:=0.0, Z:=25.0}, IdentityRotation())
Prop := SpawnedProp(0)
if (CubeProp := Prop?):
spawn { PrintPropLocation(CubeProp) }
CubeProp.MoveTo(vector3{X:=300.0, Y:=0.0, Z:=25.0}, IdentityRotation(), 30.0)
PrintPropLocation(Prop:creative_prop)<suspends>:void=
loop:
Print("Prop Location: {(Prop.GetTransform().Translation)}")
Sleep(0.1)
4 Likes
Thank you! This is very helpful