From 937b298d83c3c8f82ee0cca4c65bfe17194a7098 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Mon, 2 Sep 2024 19:27:26 +0200 Subject: [PATCH] fix a few virtual hand component visibility issues --- Handbook/src/appendix/changelog.md | 2 ++ .../Private/SenseGlove/Components/SGVirtualHandComponent.cpp | 4 ++-- Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Handbook/src/appendix/changelog.md b/Handbook/src/appendix/changelog.md index 4df80c93..0b03a193 100644 --- a/Handbook/src/appendix/changelog.md +++ b/Handbook/src/appendix/changelog.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fix a bug where the hands are always visible even when `bVisibleWhenHandDataUnavailable` is disabled. +- Fix a bug where the `HandVisibilityChangedEvent` event is not triggered on the virtual hand component visibility changes. - Fix the wrong script name for `USGHMDTrackerKismetLibrary`. - Fix the wrong script name for `USGXRTrackerKismetLibrary `. - Fix `LogPython: Warning: 'SGHMDTrackerKismetLibrary' and 'SGXRTrackerKismetLibrary' have the same name (SenseGloveHeadMountDisplayKismetLibrary) when exposed to Python. Rename one of them using 'ScriptName' meta-data.` when packaging the game. diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp index c1316046..9388b319 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp @@ -731,7 +731,7 @@ void USGVirtualHandComponent::FImpl::RestoreCollisionResponse() const void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible) { - Owner->SetVisibility(bInVisible, true); + Owner->SetHiddenInGame(!bInVisible, false); if (bInVisible) { @@ -798,7 +798,7 @@ void USGVirtualHandComponent::FImpl::UpdateVisibility() if (bSetNewVisibility) { - Owner->SetHiddenInGame(bHandDataAvailable); + SetVisibility(bHandDataAvailable); } } diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp index 43803d6d..ad2c69c3 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp @@ -1986,7 +1986,7 @@ void ASGPawn::FImpl::SetVisibility(USceneComponent* SceneComponent, const bool b return; } - SceneComponent->SetHiddenInGame(!bVisibility); + SceneComponent->SetHiddenInGame(!bVisibility, false); } void ASGPawn::FImpl::UpdateHandLocation(const bool bRight, const FVector& Location, const bool bUpdateVirtualHand) const