如果 StaticMeshComponent 不移动并且普通 MeshComponent 只需要骨架网格物体,如何移动网格物体?

问题描述 投票:0回答:0

我游戏中的主角是一艘小型宇宙飞船。我使用 Character C++ 类来移动它(使用函数 AddInputMovement())。

但是,它只有在没有附加 MeshComponent 的情况下才会移动。如果我附加 StaticMeshComponent 它根本不会对任何键做出反应并停止移动(可能是因为 StaticMeshComponent 必须是静态的......),而如果我附加一个普通的 MeshComponent,它需要蓝图编辑器中的Skeletal网格,虽然我的宇宙飞船 .fbx 模型不是骨架网格物体。

我该怎么办?我应该使用另一种类型的网格还是有办法强制 StaticMeshComponent 移动?

ASpaceship::ASpaceship()
{
    PrimaryActorTick.bCanEverTick = true;

    // !!! These lines prevent the character from moving for some reason...
    MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComponent"));
    RootComponent = MeshComponent;
unreal-engine4 unreal-engine5 unreal-blueprint
© www.soinside.com 2019 - 2024. All rights reserved.