initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "WalkAnimInstance.h"
|
||||
#include "GameFramework/Pawn.h"
|
||||
#include "GameFramework/PawnMovementComponent.h"
|
||||
|
||||
|
||||
void UWalkAnimInstance::NativeInitializeAnimation()
|
||||
{
|
||||
if (Pawn == nullptr)
|
||||
{
|
||||
Pawn = TryGetPawnOwner();
|
||||
}
|
||||
|
||||
if (IsValid(Pawn))
|
||||
{
|
||||
MovementComponent = Pawn->GetMovementComponent();
|
||||
}
|
||||
}
|
||||
|
||||
void UWalkAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
|
||||
{
|
||||
if (Pawn && MovementComponent)
|
||||
{
|
||||
Speed = Pawn->GetVelocity().Size();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user