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

[UE] Bug: TS定义一个的property组件找不到SetAnimClass()函数 #1725

Open
3 tasks done
dawnarc opened this issue May 17, 2024 · 5 comments
Open
3 tasks done
Assignees
Labels
bug Something isn't working Unreal

Comments

@dawnarc
Copy link
Contributor

dawnarc commented May 17, 2024

前置阅读 | Pre-reading

Puer的版本 | Puer Version

master分支

UE的版本 | UE Version

5.0.3

发生在哪个平台 | Platform

win

错误信息 | Error Message

测试代码:
image
运行时报错:
2024 05 17_王爱国 8b8018dfa3def78ff978c3dcf3fbf5ff
C++定义的mesh没这个问题,调用SetAnimClass()不报错,且结果符合预期。

问题重现 | Bug reproduce

如上所述

@dawnarc dawnarc added bug Something isn't working Unreal labels May 17, 2024
@chexiongsheng
Copy link
Collaborator

定义一个变量没赋值不是应该是空吗?
你C++定义没赋值也是个随机值吧?

@dawnarc
Copy link
Contributor Author

dawnarc commented May 18, 2024

@chexiongsheng

定义一个变量没赋值不是应该是空吗?

Puerts新版本中貌似只要定义变量,就会自动创建对象,不用像以前在构造中手动CreateDefaultSubobject了吧?

你C++定义没赋值也是个随机值吧?

C++定义的是已经创建好对象的(前面我说的不严谨,我说的c++的mesh其实是引擎Character内自带的Mesh)

@dawnarc
Copy link
Contributor Author

dawnarc commented May 18, 2024

@chexiongsheng 刚刚用最新的5.4.1版本测了下,定义的成员变量如果为StaticMesh会自动创建,如果为SkeletalMesh,不会自动创建
image
image

将类型从StaticMesh改成SkeletalMesh,蓝图中就看不见这个组件了:
image
image
这种属于正常情况吗?
另外5.0.3版本下SkeletaMesh类型的成员变量不用手动CreateDefaultSubobject,也会在蓝图中自动生成组件。(5.03是公司项目引擎版本,各种原因导致无法升到5.4)

@chexiongsheng
Copy link
Collaborator

只有UActorComponent子类才会添加:b3c9c59

@dawnarc
Copy link
Contributor Author

dawnarc commented May 22, 2024

@chexiongsheng 我看代码SkeletalMeshComponent的父类也是UActorComponent,按理说应该也能够生成:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Unreal
Projects
None yet
Development

No branches or pull requests

2 participants