
Once an object has a VisualUI document, calling getData() on it closes TTS immediately with a stack overflow. Nothing is shown to the player and no Lua error is raised.
Environment: TTS 2.0 public beta (Steam build 27134291, 2026-12-03); Unity 6000.7.0b9; Linux desktop; singleplayer host.
Reproduce (Global, on an empty singleplayer table):
local obj = spawnObject({type = "BlockSquare", position = {0, 2, 0}})
-- wait a frame or two, then:
obj.VisualUI.setDocument(
{format = "tts-ui", version = 1, id = "repro", root = "root",
nodes = {root = {component = "tts.text", props = {text = "hi"}}}},
{space = "object", position = {0, 1, 0}, rotation = {90, 0, 0}, width = 100, height = 50})
print(#obj.getJSON(false)) -- fine: 908 bytes
local d = obj.getData() -- the game closes hereExpected: a table that includes the document, the same data getJSON() returns: "VisualUI": {"Document": {...}, "Placement": {...}}.
Actual: the process dies. getData() on the same block before setDocument works.
Log (Player.log; frames shortened):
Stack overflow in unmanaged: IP: 0x71efb3a79740, fault addr: 0x7ffec79bbab8
at string.Concat (string[])
at LuaCustomConverter.GetTable (object, Script)
at LuaCustomConverter.ObjectToTable (Script, object)
at ClrToScriptConversions.ObjectToDynValue (Script, object)
at DynValue.FromObject (Script, object)
at Table.set_Item (object, object)
at LuaCustomConverter.GetTable (object, Script)
... the same five frames repeat; GetTable appears about 7,800 times ...It looks as if the converter that turns object data into a Lua table recurses without end into the stored VisualUI document. Reproduced twice: on a card in our table, and with the script above on an empty table.
Why it matters: getData() is the documented way to copy an object (“Works with spawnObjectData”). Any mod that clones, saves or inspects objects will crash the game as soon as one of them uses VisualUI.
It also reaches through containers. A deck’s getData() includes each card’s VisualUI document under ContainedObjects, and converting it crashes in the same way. Our table checks every newly spawned deck in onObjectSpawn with getData(), so just stacking 10 cards that had VisualUI documents into a deck crashed the game (log: LuaGlobal.OnObjectSpawn -> ConvertIListToTable -> the same recursion). A pcall around the call doesn’t help, because a stack overflow isn’t a Lua error.
Workaround: getJSON() works and includes the document. Avoid getData() on any object that has, or may have, a VisualUI document.

