端的にUnrealC++から以下のコンポーネントを追加します。
- ActorComponent
- SceneComponent
#include "MyActor.h"
#include "Components/StaticMeshComponent.h"
#include "GameFramework/FloatingPawnMovement.h"
// Sets default values
AMyActor::AMyActor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
// Sceneコンポネントをアタッチ
Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
RootComponent = Cast<USceneComponent>(Mesh);
// Actorコンポネントをアタッチ
FloatingMovement = CreateDefaultSubobject<UFloatingPawnMovement>(TEXT("FloatingMovement"));
AddOwnedComponent(FloatingMovement);
}
是非試してみてください~