I made a post about this earlier, but didn’t realize what the problem was then. Since then it appears to be a Verse bug with arrays.
Using the following two Verse scripts:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
test_device := class<concrete>(creative_device):
@editable
TestArray<public> : []test_device2 = array{test_device2{}}
OnBegin<override>()<suspends>:void=
if ( Device := TestArray[1]):
Device.TestFunction()
if ( Device := TestArray[0]):
Device.TestFunction()
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }
test_device2 := class<concrete>(creative_device):
@editable
TestProp<public> : creative_prop = creative_prop{}
TestFunction<public>():void=
Print("{TestProp.GetTransform().Translation}")
And constructing them in such a way that both the first and second array elements point to the same test_device2 instance, you can confirm calling the first element causes an error, whereas calling the second element does not:
LogVerse: Error: VerseRuntimeErrors: GetTransform called on disposed object. Use .IsDisposed[] to check before calling.
This also happens when using a for statement.