+1 Also some additional info IT IS PICKABLE but only works with the legacy ball spawner which is not found in the content drawer, the “new” ball spawner device does not work with verse
ok perfect i can use a tag on the ball, but when i change the ditable to a tag the code doesent work. i have code to attach the ball device to the player. do you know how i could do this? This is my code:using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/Characters}
using { /UnrealEngine.com/Temporary/SpatialMath}
A Verse-authored creative device that can be placed in a level
BallDeviceController := class(creative_device):
# The player spawner to activate the verse script.
@editable
PlayerSpawner : player_spawner_device = player_spawner_device{}
# The ball device that is attached to the player.
@editable
Ball : ball_device = ball_device{}
# Determines how far away from the player the ball device will be placed.
@editable
var BallOffset : float = 500.0
# Determines how high above the player the ball device will be placed.
@editable
var BallHeightOffset : float = 0.0
OnBegin<override>()<suspends>:void=
# Wait until the player spawns to execute the loop.
SpawnedAgent := PlayerSpawner.SpawnedEvent.Await()
if:
# Getting the Fort Character of the spawned player.
PlayerCharacter := SpawnedAgent.GetFortCharacter[]
then:
loop:
# Get the player location.
PlayerLocation := PlayerCharacter.GetTransform().Translation
# Get the player rotation.
PlayerRotation := PlayerCharacter.GetViewRotation()
# Get local forward vector of the player.
LocalForward := PlayerRotation.GetLocalForward()
# Calculate the new location with offset.
NewLocation := PlayerLocation + LocalForward * BallOffset + vector3{X:=0.0, Y:=0.0, Z:=BallHeightOffset}
# Teleport the ball device to the desired position and rotation.
if:
Ball.TeleportTo[NewLocation, PlayerRotation]
Sleep(0.0)
You have to connect the verse tag to the device via the device then click the add button its on the right then verse tag markup.
If verse do something like
for(BallSpawners : FindCreativeObjectsWithTag(YourTagName{}):
if(BallSpawner := ball_spawner_device):
# Do something with ball Spawner
Also within you OnBegin you should run functions not run code. It keeps it clean and will make the code continue. Atm the verse code will do nothing until a player spawns even if you have func() ect after the Await nothing will work until it succeeds the Await()
What you should do is
OnBegin
spawn{MoveBall()} - This allow the MoveBall() to take time then the body of the function will be like
MoveBall():void=
Your Code Here
Run another func() here → line after Spawn{MoveBall()} under OnBegin
This will run as you have spawned a function to handle the Awaits()
@Flak Good morning Flak. Can someone from the forum team look into this issue i just noticed. Im trying to explain and show the < s u s p e n d s > (Works with gaps) specifier but for some reason even though its showing in my text (ref to the image) its not showing in the reply and this will cause confusion with people who dont 100% understand