Using Vector2i as a Map Key Causes Character Freeze and Disconnection

Summary

Using a Vector2i as a key in a map causes the character to freeze and disconnect from the game when interacting with the map during gameplay. No Verse errors are thrown, making the issue difficult to debug

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

  1. Use the device below
  2. Compile the Verse code.
  3. Link input device to the device below
  4. Start the game.
  5. Move the character around normally.
  6. Press the E key to trigger the code that uses the map with the Vector2i key.
  7. Observe the character freezing and the disconnect behavior.
using { /UnrealEngine.com/Temporary/SpatialMath}
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

hello_world_device := class(creative_device):
    @editable
    Input: input_trigger_device = input_trigger_device{}

    OnBegin<override>()<suspends>:void=
        MyClass: my_class = my_class{}
        loop:
            Input.PressedEvent.Await()
            Print("Begin Func")
            MyClass.Func()

my_class := class:
    var AAA: [vector2i]int = map{}
    Func():void=
        for:
            X := 1..1
            Y := 1..1
        do:
            Vec := vector2i{X:=X,Y:=Y}
            if(set AAA[Vec] = 1):
                Print("set ok: {X}-{Y}")
            else:
                Print("set failed: {X}-{Y}")

Expected Result

The character should move normally after pressing the E key, and no disconnect or freezing should occur when using Vector2i as a map key

Observed Result

After pressing the E key, the character immediately freezes and becomes unresponsive. Shortly after, a red disconnect error appears in the UEFN log, and the player is kicked back to the Fortnite lobby without any Verse error message.

Platform(s)

Windows

Video