【问题标题】:UE4: How to create a USceneComponent in C++ and move it in blueprint viewportUE4:如何在 C++ 中创建 USceneComponent 并将其移动到蓝图视口中
【发布时间】:2021-06-30 00:38:43
【问题描述】:

在我的角色 cpp 中,我想定义两个 USceneComponent 变量并使用 CreateDefaultSubobject 创建它们。我需要添加哪些 UPROPERTY 或其他内容才能在继承自 c++ 类的蓝图视口中移动场景组件?

【问题讨论】:

    标签: c++ unreal-engine4


    【解决方案1】:

    您必须创建一个成员变量并使其可见

    UPROPERTY(VisibleAnywhere)
    USceneComponent* SceneComponent;
    

    如果您打算在蓝图中访问该组件,也可以添加BlueprintReadOnlyBlueprintReadWrite

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-26
      • 1970-01-01
      • 2019-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多