0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[UE4]CharacterMovementをProjectで作成したものに切り替える

Posted at

カスタムしたCharacterMovementを利用した場合など。
FObjectInitializer、SetDefaultSubobjectClassを利用すると上書きできる

詳しくはhistoriaさんの記事を参照
https://historia.co.jp/archives/6587/

Characterクラス準備

GENERATED_BODY()→GENERATED_UCLASS_BODY()
ヘッダーのコンストラクタを削除
UMyCharacterMovementComponentをincludeしておく
以下のようにコンストラクタを調整する

AAA::AAA(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer.SetDefaultSubobjectClass<UMyCharacterMovementComponent>(ACharacter::CharacterMovementComponentName))

CharacterMovementComponentの準備

UMyCharacterMovementComponentをUCharacterMovementComponentから継承して作成

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?