First I noticed that the documentation is not up-to-date, the UE object on the javascript side is window.ue and not window.ue4. I tried to create a pull-request to fix it, but got a 405 Not Allowederror.
I managed to call c++ functions from javascript with my bound UObject, however, I can’t access any of its properties (by reading the C++ code, I think it is maybe normal) and more important, the function parameters that I send from the javascript side do not arrive in the C++ side, and I can’t get any result back.
I know bound functions return a javascript promise, but I can’t read the returned value with them.
UCLASS(Blueprintable, BlueprintType)
class UJSLink : public UObject
{
GENERATED_UCLASS_BODY()
public:
UPROPERTY()
FString InaccessibleUProperty;
UFUNCTION(BlueprintCallable)
float FunctionA(float bInvisibleParameter);
};
// .cpp side:
float UJSLink::FunctionA(float bInvisibleParameter) {
return bInvisibleParameter; // it could be return 456; it would not change anything.
}