ProxSphere = CreateDefaultSubobject<USphereComponent>(TEXT("ProxSphere"), false);
Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"), false);
// make the root object the Mesh
RootComponent = Mesh;
ProxSphere->AttachToComponent( Mesh, FAttachmentTransformRules::KeepRelativeTransform );
老方法里面是AttachTo就可以,但现在会提出警告
Unreal 给Actor添加Component
最新推荐文章于 2025-02-03 10:33:25 发布