# I want to know under what conditions this error occurs in Verse.

**URL:** <https://forums.unrealengine.com/t/i-want-to-know-under-what-conditions-this-error-occurs-in-verse/1841137>\
**Category:** Verse\
**Tags:** fortnite-creative, question, fortnite\
**Created:** [May 5, 2024, 11:52am UTC](https://forums.unrealengine.com/t/i-want-to-know-under-what-conditions-this-error-occurs-in-verse/1841137 "2024-05-05T11:52:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![haganeiro](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/haganeiro/32/772004_2.png) [@haganeiro](https://forums.unrealengine.com/u/haganeiro)\
**Post date:** [May 5, 2024, 11:52am UTC](https://forums.unrealengine.com/t/i-want-to-know-under-what-conditions-this-error-occurs-in-verse/1841137/1 "2024-05-05T11:52:17Z")

</div>

LogVerse: Error: VerseRuntimeErrors: Verse unrecoverable error: ErrRuntime\_InvalidVarRead: Attempted to read a `var` out of an invalid object.

When this happens, Verse will crash and stop working.

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [May 5, 2024, 12:40pm UTC](https://forums.unrealengine.com/t/i-want-to-know-under-what-conditions-this-error-occurs-in-verse/1841137/2 "2024-05-05T12:40:37Z")

</div>

hi @haganeiro ,  
My guess is that the _var_ has not been assigned a value.

```auto
var MyValue : int #would fail with runtime error invalid object referenced

var MyValue : int = 0 # will work aa a value has been set

The value could be set by by the by assignment

var MyValue : int  
set MyValue = 0

```

If it was a _constant_ this would fail in compile as the strong checks of the compiler

> **[Verse Language Quick Reference | Unreal Editor For Fortnite Documentation |...](https://dev.epicgames.com/documentation/en-us/uefn/verse-language-quick-reference#constantsandvariables)**
>
> Need to refresh on a Verse feature? This quick reference can help!

---

<div class="post-metadata">

**Author:** ![haganeiro](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/haganeiro/32/772004_2.png) [@haganeiro](https://forums.unrealengine.com/u/haganeiro)\
**Post date:** [May 5, 2024, 12:52pm UTC](https://forums.unrealengine.com/t/i-want-to-know-under-what-conditions-this-error-occurs-in-verse/1841137/3 "2024-05-05T12:52:57Z")

</div>

This is the problematic function indicated by the error statement. No problems have been found so far.

LogVerse: Error: VerseRuntimeErrors: Verse unrecoverable error: ErrRuntime\_InvalidVarRead: Attempted to read a `var` out of an invalid object.  
Truncated callstack follows:  
task\_GameManager$GenarateUIStart(:Generation,:agent,:GenerateChairData):Update (Unknown source) (Source: Unknown(0,0, 0,0))

```auto
GenarateUIStart(Generator : Generation,Agent : agent,SeatData : GenerateChairData)<suspends>:void=
        Print("GenerateStart",?Color := NamedColors.Yellow)
        if(set PlayerDatas[Agent].PlayerState = State.Generate):
        var EventCount : int = 0
        var CheckNow : logic = false
        GenerateSound.Play(Agent)
        race:
            loop:
                Ag := MoveXCheck.PressedEvent.Await()
                if(Ag = Agent){break}
            loop:
                Ag := MoveYCheck.PressedEvent.Await()
                if(Ag = Agent){break}
            loop:
                Ag := JumpCheck.PressedEvent.Await()
                if(Ag = Agent){break}
            loop:
                Sleep(0.1)
                Generator.AddEnergy(0.18)
                Size := (Generator.NowEnergy/100.0)
                if(not Generator.IsGenerated[]):
                    VarUpdate(Agent,Size)
            loop:
                Sleep(GetRandomFloat(7.0,13.0))
                if(SK := SkillCheck[GetRandomInt(0,SkillCheck.Length - 1)]):
                    if(Movie := SK.Cinema[PlayerDatas[Agent].PlayerNumber]):
                        Movie.Play(Agent)
                        set CheckNow = true
                        NowTime := GetSimulationElapsedTime()
                        race:
                            loop:
                                Ag := ShotCheck.PressedEvent.Await()
                                if(Ag = Agent):
                                    break
                            Movie.StoppedEvent.Await()
                        Movie.Stop(Agent)
                        Difference := Abs(GetSimulationElapsedTime() - NowTime - SK.ActiveFrame*(1.0/30.0))
                        if(Difference <= 0.06):
                            Generator.AddEnergy(1.0)
                            Print("Great")
                            GreatSound.Play(Agent)
                        else if(Difference <= 0.15):
                            Print("OK")
                            OKSound.Play(Agent)
                        else:
                            Print("Miss")
                            MissSound.Play(Agent)
                            if(FortChar := Agent.GetFortCharacter[],FortChar.IsActive[],Generator.EffectPos.IsValid[]):
                                Angele := ReturnTan(Generator.EffectPos.GetTransform(),FortChar.GetTransform())
                                var PosIn : transform = Generator.EffectPos.GetTransform()
                                set PosIn.Rotation = MakeRotationFromYawPitchRollDegrees(Angele,0.0,0.0)
                                Generator.AddEnergy(-5.0)
                                Prop := SpawnProp(MissEffect,PosIn)(0)
                                if(p := Prop?):
                                    spawn{DeleteDelay(p,3.0)}
                                break
                        Print("Diffence = {Difference}")
                        set CheckNow = false
                    
            loop:
                Generator.Shake()
                Sleep(1.0)
            loop:
                Ag := DamageEvent.Await()
                if(Ag = Agent):
                    break
            Generator.SuccsessEvent.Await()
        if(not Generator.IsGenerated[]):
            SeatData.Button.Enable()
        if(CheckNow = true and not Generator.IsGenerated[]):
            MissSound.Play(Agent)
            if(FortChar := Agent.GetFortCharacter[],FortChar.IsActive[],Generator.EffectPos.IsValid[]):
                Angele := ReturnTan(Generator.EffectPos.GetTransform(),FortChar.GetTransform())
                var Pos : transform = Generator.EffectPos.GetTransform()
                set Pos.Rotation = MakeRotationFromYawPitchRollDegrees(Angele,0.0,0.0)
                Generator.AddEnergy(-5.0)
                Prop := SpawnProp(MissEffect,Pos)(0)
                if(p := Prop?):
                    spawn{DeleteDelay(p,3.0)}
        for(SK : SkillCheck):
            if(Movie := SK.Cinema[PlayerDatas[Agent].PlayerNumber]):
                Movie.Stop(Agent)
        GenerateSound.Stop(Agent)
        if(Chair := PlayerDatas[Agent].SeatChair?):
            Chair.Eject(Agent)
        VarHide(Agent)
        if(set PlayerDatas[Agent].SeatChair = false):
        Print("GenerateEnd",?Color := NamedColors.Yellow)
        if(PlayerDatas[Agent].PlayerHealth >= 1.0):
            if(set PlayerDatas[Agent].PlayerState = State.Free):
                Print("Free")
        return

```

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [May 6, 2024, 11:14am UTC](https://forums.unrealengine.com/t/i-want-to-know-under-what-conditions-this-error-occurs-in-verse/1841137/4 "2024-05-06T11:14:47Z")

</div>

hi @haganeiro ,  
This is speculation .The only lines that matches the error log

```auto
                                Angele := ReturnTan(Generator.EffectPos.GetTransform(),FortChar.GetTransform())
                              
                                set PosIn.Rotation = MakeRotationFromYawPitchRollDegrees(Angele,0.0,0.0)

```

Angele according to output log is 0

MakeRotationFromYawPitchRollDegrees(Angele,0.0,0.0)

Source: Unknown(0,0, 0,0))  
matches  
The real value would be found by putting Log.Print statement after the assignment and look in the Fortnite log window while running.

Put a Log.Print for the PosIn.Rotation and check the value.  
Possibly this wont print because of the runtime error.  
Just the usual tedious Print statements until the error is found.

Dont have any more ideas

---

<div class="post-metadata">

**Author:** ![haganeiro](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/haganeiro/32/772004_2.png) [@haganeiro](https://forums.unrealengine.com/u/haganeiro)\
**Post date:** [May 6, 2024, 1:31pm UTC](https://forums.unrealengine.com/t/i-want-to-know-under-what-conditions-this-error-occurs-in-verse/1841137/5 "2024-05-06T13:31:44Z")

</div>

ReturnTan has “transacts”. Could this be the problem?

```auto
ReturnTan(T1 : transform,T2 : transform)<transacts>:float=
        Angle := ArcTan(T2.Translation.Y - T1.Translation.Y,T2.Translation.X - T1.Translation.X)*180/PiFloat
        return Angle

```

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [May 6, 2024, 9:15pm UTC](https://forums.unrealengine.com/t/i-want-to-know-under-what-conditions-this-error-occurs-in-verse/1841137/6 "2024-05-06T21:15:57Z")

</div>

According to the manual linked above your code is by default fully described as

```auto
<transacts><no_rollback> #only allowed in UEFN API 

```

So if there is an error there is no fallback on error so you will need

```auto
<decides><transacts>

```

Trying control-f to search with _ **transacts** _

they all say

```auto
<decides><transacts>

```

There may be an error in your code which will now show up

see

> **[Verse Language Quick Reference | Unreal Editor for Fortnite Documentation |...](https://dev.epicgames.com/documentation/en-us/uefn/verse-language-quick-reference#functioncalls)**
>
> Need to refresh on a Verse feature? This quick reference can help!

```auto
IsPuzzleSolved()<decides><transacts> : void =
    CurrentState = PuzzleSolution # succeeds if CurrentState is equal to PuzzleSolution, and fails if not

Main() : void =
    if (IsPuzzleSolved[]):
        ItemSpawner.Enable()

```

In this code The function PuzzleSolution is now protected from runtime errors and is detected in

```auto
    if (IsPuzzleSolved[]):

```

This means you can print if an error occurs or carry on.

in the documentation above Control + F and search for the word **transact**

There are over 20 examples of the use of

```auto
<decides><transacts>

```

for many operations in Verse
