-
Notifications
You must be signed in to change notification settings - Fork 426
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
c++定义USTRUCT给lua使用,在C++中通过RPC调用lua代码时报错 #589
Comments
谢谢大佬的回复! 我用的版本是:sluaunreal-2.1.2 我想要定义一个UStruct结构体FPlayerData,从C++传递(const TArray&)到Lua中,想在lua中访问从C++传递过来的FPlayerData数组 1.定义FPlayerData public:
}; namespace NS_SLUA 2.定义一个PlayerController,提供一个服务端调用客户端执行的RPC函数
} void AXXXPlayerController::ClientUpdatePlayer_Implementation(const TArray& PlayerDatas) template<class ...ARGS> 代码调用过程: 在Server端通过ClientUpdatePlayer将const TArray& PlayerDatas传递到ClientClientUpdatePlayer_Implementation 最终将PlayerDatas通过callField方法传递到了Lua的UpdatePlayer方法中 发现在Lua中无法使用PlayerDatas数据,并且报上面的错误日志 请问一下,应该如何正确的传递自定义的USTRUCT并通过const TArray& 传递到lua层? |
OK,我明天抽空构造一下现场看看 |
好的,谢谢大佬 |
报错日志:
LogProperty: Error: Struct type unknown for property 'StructProperty /Engine/Transient.Struct_0:TransientLuaProperty'; perhaps the USTRUCT() was renamed or deleted?
我写的代码:
这里通过const TArray& 传递PlayerDatas到lua,会提示上面的报错
请问下,这个正确的用法是怎么样的?
The text was updated successfully, but these errors were encountered: