# object disposed when updating verse only

**URL:** <https://forums.unrealengine.com/t/object-disposed-when-updating-verse-only/1151499>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [May 2, 2023, 4:49am UTC](https://forums.unrealengine.com/t/object-disposed-when-updating-verse-only/1151499 "2023-05-02T04:49:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![InsanePete](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/insanepete/32/641314_2.png) [@InsanePete](https://forums.unrealengine.com/u/InsanePete)\
**Post date:** [May 2, 2023, 4:49am UTC](https://forums.unrealengine.com/t/object-disposed-when-updating-verse-only/1151499/1 "2023-05-02T04:49:25Z")

</div>

Similar to [creative\_prop MoveTo disposed error when called from other Verse](https://forums.unrealengine.com/t/creative-prop-moveto-disposed-error-when-called-from-other-verse/837372) but with different causes.

I’ve been getting the dreaded run-time error:  
`[2023.05.02-04.37.50:700][33]LogVerse: Error: VerseRuntimeErrors: GetTransform called on disposed object. Use .IsDisposed[] to check before calling.`

So I’ve bracketed my access of that Prop with:  
`if (Prop.IsValid[]):`

_(Quick side-note: please fix the error message, it took me a ridiculously long time to stop searching for IsDisposed in all the digests, and find the comment above GetTransform that gives the correct function name)_

Unfortunately, once this fails, it fails forever - that Prop reference is never coming back in that function.  
Even though the Prop is visible on the screen.  
Even though a thread is actively controlling it and moving it around using the exact same variable in the same class.

The _interesting_ part is that it only ever happens when I “Push Verse Changes”. It works perfectly if I “Push Changes”… unfortunately that takes over a minute to deploy and start where “Push Verse Changes” is about 10 seconds.

FYI here’s the code, LaunchPoint and AimPoint are the functions that fail if I update the Verse Changes alone. MoveTowards works perfectly all the time.

```auto
gun_manager := class(creative_device):
    @editable PlayerManager : player_manager = player_manager {}
    @editable Prop : creative_prop = creative_prop {}

    var StartPos : vector3 = vector3{}
    var DefaultRot : rotation = rotation {}
    var DefaultYPR : [] float = array {}
    var MyProp : creative_prop = creative_prop {}

    OnBegin<override>()<suspends>:void=
        #spawn{ TurnToFace() }
        spawn{ MoveTowards() }
        Print("GunManager is ready")

    LaunchPoint():vector3=
        if (Prop.IsValid[]):
            PropTransform := Prop.GetTransform()
            PropPosition := PropTransform.Translation
            PropRotation := PropTransform.Rotation
            OffsetPosition := PropPosition + PropRotation.RotateVector(vector3{ X:=50.0, Y:=00.0, Z:=20.0 })
            return OffsetPosition
        else:
            Print("Can't get LaunchPoint yet")
            return vector3{}

    AimPoint():vector3=
        if (Prop.IsValid[]):
            PropTransform := Prop.GetTransform()
            PropPosition := PropTransform.Translation
            PropRotation := PropTransform.Rotation
            OffsetPosition := PropPosition + PropRotation.RotateVector(vector3{ X:=5000.0, Y:=0.0, Z:=20.0 })
            return OffsetPosition
        else:
            Print("Can't get AimPoint yet")
            return vector3{}
    

    MoveTowards()<suspends>:void=
        Print("MoveTowards started")
        loop:
            if (Player := PlayerManager.GetCharacter[0]):

                PropTransform := Prop.GetTransform()
                PropPosition := PropTransform.Translation

                PlayTransform := Player.GetTransform()
                PlayPosition := PlayTransform.Translation
                PlayRotation := PlayTransform.Rotation

                OffsetPosition := PlayPosition + PlayRotation.RotateVector(vector3{ X:=0.0, Y:=70.0, Z:=60.0 })

                # move smoothly
                SpawnTask := spawn{ Prop.MoveTo(OffsetPosition, PlayRotation, 0.5) }
                # block until move is complete
                SpawnTask.Await()
            Sleep(0.0)

```

The only difference is that MoveTowards is fired up from OnBegin, and the other two functions are called from a Weapon class with an object pool for the bullets.
