From 58e46e7798527be987fd33864711f0dd0551cd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fa=20Can=20Yan=C4=B1ko=C4=9Flu?= Date: Fri, 8 Oct 2021 12:58:23 +0300 Subject: [PATCH 1/4] Add missing uproperty for debug component --- Source/ALSV4_CPP/Public/Character/ALSPlayerCameraManager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/ALSV4_CPP/Public/Character/ALSPlayerCameraManager.h b/Source/ALSV4_CPP/Public/Character/ALSPlayerCameraManager.h index 4a0d96f2..d9a55829 100644 --- a/Source/ALSV4_CPP/Public/Character/ALSPlayerCameraManager.h +++ b/Source/ALSV4_CPP/Public/Character/ALSPlayerCameraManager.h @@ -77,5 +77,6 @@ class ALSV4_CPP_API AALSPlayerCameraManager : public APlayerCameraManager FVector DebugViewOffset; private: + UPROPERTY() UALSDebugComponent* DebugComponent = nullptr; }; From 9d75c6bdc2c0b2e575a78969d5def9ca069cdcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fa=20Can=20Yan=C4=B1ko=C4=9Flu?= Date: Fri, 8 Oct 2021 12:58:53 +0300 Subject: [PATCH 2/4] Add another missing uproperty --- Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h b/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h index 9aeaa1a9..f275c670 100644 --- a/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h +++ b/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h @@ -113,5 +113,6 @@ class ALSV4_CPP_API UALSMantleComponent : public UActorComponent UPROPERTY() AALSBaseCharacter* OwnerCharacter; + UPROPERTY() UALSDebugComponent* DebugComponent = nullptr; }; From f18bf3d338612f39686bc60e2aa50d76a36e62b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fa=20Can=20Yan=C4=B1ko=C4=9Flu?= Date: Fri, 8 Oct 2021 12:59:56 +0300 Subject: [PATCH 3/4] Fix last batch of missing UPROPERTYs --- Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h | 1 + .../Public/Character/Animation/ALSCharacterAnimInstance.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h b/Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h index 6afdd70a..712a7fb7 100644 --- a/Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h +++ b/Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h @@ -645,5 +645,6 @@ class ALSV4_CPP_API AALSBaseCharacter : public ACharacter bool bEnableNetworkOptimizations = false; private: + UPROPERTY() UALSDebugComponent* DebugComponent = nullptr; }; diff --git a/Source/ALSV4_CPP/Public/Character/Animation/ALSCharacterAnimInstance.h b/Source/ALSV4_CPP/Public/Character/Animation/ALSCharacterAnimInstance.h index de09bdd4..6d850a38 100644 --- a/Source/ALSV4_CPP/Public/Character/Animation/ALSCharacterAnimInstance.h +++ b/Source/ALSV4_CPP/Public/Character/Animation/ALSCharacterAnimInstance.h @@ -320,5 +320,6 @@ class ALSV4_CPP_API UALSCharacterAnimInstance : public UAnimInstance bool bCanPlayDynamicTransition = true; + UPROPERTY() UALSDebugComponent* DebugComponent = nullptr; }; From 62fee0de8f43b6ec10d2972cbf7a64a2580f56b6 Mon Sep 17 00:00:00 2001 From: adrian-j-programmer <52369028+adrian-j-programmer@users.noreply.github.com> Date: Fri, 15 Oct 2021 16:50:21 +0200 Subject: [PATCH 4/4] Fix #295 Remove race condition between first replication pass and first frame update that can lead to rotation mode being set to VelocityDirection in a client-server scenario. --- .../Character/Animation/ALSCharacterAnimInstance.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/ALSV4_CPP/Private/Character/Animation/ALSCharacterAnimInstance.cpp b/Source/ALSV4_CPP/Private/Character/Animation/ALSCharacterAnimInstance.cpp index 9a39dbf2..13c09838 100644 --- a/Source/ALSV4_CPP/Private/Character/Animation/ALSCharacterAnimInstance.cpp +++ b/Source/ALSV4_CPP/Private/Character/Animation/ALSCharacterAnimInstance.cpp @@ -70,7 +70,7 @@ void UALSCharacterAnimInstance::NativeUpdateAnimation(float DeltaSeconds) { Super::NativeUpdateAnimation(DeltaSeconds); - if (!Character || DeltaSeconds == 0.0f) + if (!Character) { // Fix character looking right on editor RotationMode = EALSRotationMode::VelocityDirection; @@ -79,6 +79,12 @@ void UALSCharacterAnimInstance::NativeUpdateAnimation(float DeltaSeconds) return; } + if (DeltaSeconds == 0.0f) + { + // Prevent update on the first frame (potential division by zero) + return; + } + // Update rest of character information. Others are reflected into anim bp when they're set inside character class CharacterInformation.Velocity = Character->GetCharacterMovement()->Velocity; CharacterInformation.MovementInput = Character->GetMovementInput();