在关卡蓝图中引用Actor运行lua actor函数会crash
gunsungithub opened this issue · comments
LeonZhao commented
Describe the bug
将luaActor子类放入关卡,在关卡蓝图中引用它,并调用有lua版本的函数,导致崩溃。
Version
lua 2.0.1
UE 5.1
To Reproduce
制作一个名为BP_MyLuaActor
的蓝图,父类为AMyLuaActor
CDO中配置好lua路径
放置到关卡中,如下图执行
class DEMOCPP_API AMyLuaActor : public ALuaActor
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void MyNaciveFunctionLua(float FloatParameter, int32 IntParameter);
void MyNaciveFunctionLua_Implementation(float FloatParameter, int32 IntParameter);
};
local BP_MyLuaActor = {}
function BP_MyLuaActor:MyNaciveFunctionLua(float, int)
print("called from MyNaciveFunctionLua", float, int)
end
local CLuaActor = require("MyLuaActor")
return Class(CLuaActor, nil, BP_MyLuaActor)
Expected behavior
不崩溃并执行lua版本函数
Crash
调试下来,是因为这里的
Children
为空,改为ChildProperties
就好了。
Desktop (please complete the following information):
- OS: Windows
Additional context
大佬看看怎么改吧
zjhongxian commented
感谢反馈,这个应该是版本兼容问题,4.18应该是用Children,高版本用ChildProperties
zjhongxian commented
感谢反馈,这个应该是版本兼容问题,4.18应该是用Children,高版本用ChildProperties
可以关注下我个人分支,我编译验证后,估计今晚8点前提交