Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

仅在instance配置lua path,不能绑定脚本 #524

Open
gunsungithub opened this issue Jun 8, 2023 · 3 comments
Open

仅在instance配置lua path,不能绑定脚本 #524

gunsungithub opened this issue Jun 8, 2023 · 3 comments

Comments

@gunsungithub
Copy link

gunsungithub commented Jun 8, 2023

Describe the bug
将lua路径默认值为空的lua actor子类放入场景,在场景中修改其lua路径,不会执行lua版本的函数。

Version
lua 2.0.1
UE 5.1

To Reproduce
如题,并在关卡蓝图中执行该函数

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 MyLuaActor = {}

function MyLuaActor:MyNaciveFunctionLua(float, int)
    print("called from MyNaciveFunctionLua",float, int)
end

local CLuaActor = require("LuaActor")
return Class(CLuaActor, nil, MyLuaActor)

Expected behavior
执行lua版本的函数

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Windows

Additional context
我调试发现,在绑定时,路径信息还没有。如果时CDO中配置路径就没问题。
如果认为这样做不是正确的配置方法,可以改为feature。

@gunsungithub
Copy link
Author

貌似可以用virtual void PostDuplicate(bool bDuplicateForPIE) {}处理一下

@zjhongxian
Copy link
Collaborator

动态在场景里面修改设置应该是还没能支持

@zjhongxian
Copy link
Collaborator

动态在场景里面修改设置应该是还没能支持

我得空看看能不能支持下,不过我近段时间赶业务,可能要稍晚些

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants