Constrain VampireCharacter actors to XY axis in Character Movement Component

This commit is contained in:
baz 2025-02-15 00:30:46 +00:00
parent bd510f297c
commit c133ccd1e9
2 changed files with 5 additions and 3 deletions

BIN
Content/Enemy/BP_TestEnemy.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -4,8 +4,8 @@
#include "VampireCharacter.h"
#include "HealthComponent.h"
#include "PaperFlipbookComponent.h"
#include "WeaponInventoryComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
// Sets default values
AVampireCharacter::AVampireCharacter()
@ -21,6 +21,8 @@ AVampireCharacter::AVampireCharacter()
//Create Weapon Inventory Component
WeaponInventoryComponent = CreateDefaultSubobject<UWeaponInventoryComponent>(TEXT("Weapon Inventory Component"));
GetCharacterMovement()->SetPlaneConstraintNormal({0.0f, 0.0f, 1.0f});
}
// Called when the game starts or when spawned