Lots of refactoring related to Movement Component State. Still not done yet.
This commit is contained in:
@@ -239,3 +239,15 @@ FKey UlxUtilityLibrary::GetKeyByNameString(const FString &Name)
|
||||
FKey Key = FKey(FName(*Name));
|
||||
return Key.IsValid() ? Key : FKey();
|
||||
}
|
||||
|
||||
FVector UlxUtilityLibrary::GetActorForwardVelocity(const AActor *Actor, double Speed, bool bSnapToXY)
|
||||
{
|
||||
if (!Actor) return FVector::ZeroVector;
|
||||
FVector Forward = Actor->GetActorForwardVector();
|
||||
if (bSnapToXY)
|
||||
{
|
||||
Forward.Z = 0.0;
|
||||
if (!Forward.Normalize()) return FVector::ZeroVector;
|
||||
}
|
||||
return Forward * Speed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user