Passing tables from widgets with Crayta.callLua converts them to strings

Describe the bug:
Passing tables from widgets with Crayta.callLua converts them to strings. I would expect them to keep the table structure.

How do you cause this bug?

  • data object in JS:
    data =
    {
    button: [
    {
    x: 10,
    y: 10
    }
    ]
    }
  • Print in JS works: console.log(data.button.x)
  • Try to pass data to Lua: Crayta.callLua(“MyLuaFunction”, data);
  • Try to access data.button in Lua gives null exception
  • data in Lua is a string with value “button”

Screenshots / video of bug:

Which platform: PC / Stadia

Which input: Controller / keyboard + mouse

Your Crayta username:
Vilva

Game seen in (including “Hub” or “Editor for XYZ”):
Editor

How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible):

Time + date seen:

Version number (found in Help tab in Settings):

(PC only) hardware specs (upload dxdiag file if possible - Open and run DxDiag.exe):

Remember!
The more information you provide, the more likely it is that this bug can be fixed quickly! Also, if this was discussed in Discord / Reddit / elsewhere, it might help to include a screenshot of that discussion!

2 Likes

Just tested it with a few other examples and can confirm, that passing a table as argument in Crayta.callLua only passes the first key of it as a string to lua.

2 Likes

Hello and welcome to Crayta Vilva,

We have entered this issue into our database to further investigate the issue.
Thank you @Ya_shi_shi for confirming that this issue is not an isolated issue. Great teamwork! :smiling_face_with_three_hearts:

2 Likes

Any updates on this bug?
I passed a vector from lua to js and later back to lua and realised that lua still only receives the “x” string instead of {x:0,y:0,z:0} as example.

1 Like

Any updates on this bug? :face_holding_back_tears:

No