Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #include "Characters/SlashAnimInstance.h"
- #include "Characters\SlashCharacter.h"
- #include "GameFramework/CharacterMovementComponent.h"
- #include "Kismet\KismetMathLibrary.h"
- void USlashAnimInstance::NativeInitializeAnimation()
- {
- Super::NativeInitializeAnimation();
- SlashCharechter = Cast<ASlashCharacter>(TryGetPawnOwner());
- if (SlashCharechter)
- {
- SlashCharacterMovement = SlashCharechter->GetCharacterMovement();
- }
- }
- void USlashAnimInstance::NativeUpdateAnimation(float DeltaTime)
- {
- Super::NativeUpdateAnimation(DeltaTime);
- if (SlashCharacterMovement)
- {
- GroundSpeed = UKismetMathLibrary::VSizeXY(SlashCharacterMovement->Velocity);
- IsFalling = SlashCharacterMovement->IsFalling();
- CharacterState = SlashCharechter->GetCharacterState();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement