You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hasezoey edited this page Nov 7, 2017
·
3 revisions
// "MyActor" should be replaced with the Blueprint that you wantclassMyActorextendsBlueprint.Load('/Game/MyActor').GeneratedClass{// "/Game/(Path to BP)" "/Game/" can be seen as Content in Unreal's browserFunction_To_Override(){return;}}varMyActor_C=require('uclass')()(global,MyActor);functionmain(){//main function thats defined at buttomif(GWorld.IsServer){//executes only on server / hostvaractor=newMyActor_C(GWorld,{X: 1});//creates the actorreturn()=>{actor.DestroyActor();}}}try{//setup / initmodule.exports=()=>{vart=main();returnfunction(){t();}}}catch(e){require('bootstrap')('BP_Function_Override');// replace "BP_Function_Override" with the js file name}
to return a value, that was defined in the Blueprint Editor:
Function_To_Override(){return{var_name_from_BP_here: 'value you want to'};}
return does somehow not function when returning in an async function (like in a callback from request)