Replace the blueprint with Lua, keep it in a consistent way with the blueprint, and switch seamlessly. Accessing UObject's properties and methods with reflection and without the need to generate glue code, more simple and easy to expand.
Android, iOS, Mac, Windows, Linux are supported now.
- lua : Lua is a powerful, efficient, lightweight, embeddable scripting language
 - luasocket : Network support for the Lua language
 - Tencent LuaPanda : Pandora Lua Debugger for VS Code
 
- Call UFunction directly in lua
 - Access UProperty member of UClass/UStruct
 - Override BlueprintNativeEvent/BlueprintImplementable in lua
 - Override blueprint's function/event in lua
 - Override native net replicated event(Server/Client/NetMulticast) in lua
 - Override blueprint's net replicated event in lua
 
Clone Bluelua to your project's Plugins folder, regenerate project solution and build.
- 
ILuaImplementableInterfaceAll C++ classes that can be used with LUA subclasses need to be inherited from this interface and the corresponding methods are called in the corresponding virtual functions, the main types of overrideing are as follows:
All C++ classes (or blueprint classes) need to override two important
BlueprintNativeEvent:ShouldEnableLuaBinding: should use lua subclass on this C++/Blueprint class.OnInitBindingLuaPath: return corresponding lua file pathIt's optional to override
OnInitLuaState: return custom FLuaState wrapper, default use of global lua state- 
Class
AActor, seeLuaImplementableActor.h- Call 
OnInitLuaBindinginBeginPlay - Call 
OnReleaseLuaBindinginEndPlay - Call 
LuaProcessEventinProcessEvent 
 - Call 
 - 
Class
UUserWidget, seeLuaImplementableWidget.h- Call 
OnInitLuaBindinginNativeConstruct - Call 
OnReleaseLuaBindinginNativeDestruct - Call 
LuaProcessEventinProcessEvent 
The UUserWidget class also has a special place where the
LatentActionowned by the class is not affected by the pause, so you also need to overrideNativeTickand callLatentActionManagerin the virtual function to handle allLatentActionobjects. SeeTickActionsinLuaImplementableWidget.h - Call 
 - 
Class
UObject, seeRPGAnimNotifyState.hin Demo LuaActionRPG- Call 
OnReleaseLuaBindinginBeginDestroy - Call 
LuaProcessEventinProcessEvent - Because the Uobject class does not have an initialized virtual function that can be overrided, so it can call 
OnInitLuaBindingthe first time theProcessEventis called, as shown in the demo 
 - Call 
 - 
Class
UGameInstance, seeRPGGameInstanceBase.hin Demo LuaActionRPG- Call 
OnInitLuaBindinginInit - Call 
OnReleaseLuaBindinginShutdown - Call 
LuaProcessEventinProcessEvent 
 - Call 
 
 - 
 - 
keyword
SuperWhen you use Lua to subclass c++ classes or blueprints, there is a temporary global object called Super represent the parent UObject that you can access it's properties and methods. It's only avaliable when lua file is loaded(
luaL_loadbuffer), so you need to cache it's reference in your lua file likelocal MyParent = Superand useMyParentin your lua - 
CastToLuaWhen you have a UObject in lua and want to know if the object has a lua subclass, you can call
CastToLuaon that object likelocal LuaObject = OtherObject:CastToLua(), it returns a lua table represent the lua object ifOtherObjecthas a lua subclass.CastToLuaworks like cast in blueprint: - 
Modular lua subcalss
All lua subclass should implement in modular table and methods should declare with : not ., see see
GameInstance.luain Demo LuaActionRPGlocal m = {} function m:func() end return m
 - 
inheritance in lua
You can use lua metatable to implement inheritance like you do in C++ or blueprint, see PlayerCharacter.lua and Character.lua in Demo LuaActionRPG
 - 
When a UFUNCTION expose to blueprint, it can has a alias, like
BeginPlayin blueprint, it actually calledReceiveBeginPlay. so when you override this function in lua you should useReceiveBeginPlaynotBeginPlay. 
- LuaActionRPG: Epic's ActionRPG demo in lua implementation, still work in progress
 - BlueluaDemo: benchmark and test
 
- expose lua file reader to project, do not assume lua files under ProjectContent folder
 - hot reload lua
 - optimize OnProcessLuaOverrideEvent when find lua function
 
