From 4bb733e43f49a8ec3a42132763d1a31519ac6a27 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Thu, 18 May 2023 21:23:51 +0200 Subject: [PATCH] stop all haptics on end play in order to make sure the glove won't get stuck in haptics feedbacks --- .../Private/SenseGlove/Components/SGVirtualHandComponent.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp index 72d29457..0f05a7f0 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp @@ -624,6 +624,11 @@ bool USGVirtualHandComponent::FImpl::InitializeBackend() const bool USGVirtualHandComponent::FImpl::UninitializeBackend() const { + if (IsValid(Owner->Glove)) + { + Owner->Glove->StopHaptics(); + } + // NOTE // In Editor builds we should be avoiding dispose, since stopping the game in PIE mode, causes the virtual-hand // to disappear in the editor as the plugin won't be able to retrieve the glove status anymore.