ncsoft / Unreal.js

Unreal.js: Javascript runtime built for UnrealEngine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FJavascriptFunction Execute with UStaticStruct does not pass on struct values

jeebs00 opened this issue · comments

If I have an FJavascriptFunction assigned that needs 3 parameters filled I tried to use the Execute(UStaticStruct* Struct, void* Buffer) method and it does not break the struct to the different parameters or pass the values as the struct object through to JS.

JS Function

function test(itemA, itemB, itemC)
{
     console.log("A:",itemA /*int*/);
     console.log("B:",itemB /*int*/);
     console.log("C:",itemC /*int*/);
}

C++ defined Struct

USTRUCT()
struct FItems
{
     GENERATED_BODY()
     int32 itemA;
     int32 itemB;
     int32 itemC;
};

C++ execution

FItems items;
items.itemA = 1;
items.itemB = 2;
items.itemC = 3;
Function.Execute(FItems::StaticStruct(), &items);

Only the first parameter is passed as an [object FItems] while the other parameters are undefined. And if tried to access itemA.itemA (incase the values where there) you get back an undefined.