From 225dbefaa0f448322caa0b611a101ebd3f2e7c65 Mon Sep 17 00:00:00 2001 From: Greg Labute Date: Fri, 14 Jul 2023 16:20:15 -0400 Subject: [PATCH] Bugfix: CinemachineCollider was causing a pop when OnTargetObjectWarped was called. --- com.unity.cinemachine/CHANGELOG.md | 1 + .../Runtime/Behaviours/CinemachineDeoccluder.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/com.unity.cinemachine/CHANGELOG.md b/com.unity.cinemachine/CHANGELOG.md index 34b71a231..cd6f75529 100644 --- a/com.unity.cinemachine/CHANGELOG.md +++ b/com.unity.cinemachine/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Bugfix: Deceleration at the end of axis range was too aggressive. - Bugfix: Orbital recentering should not be forced when transitioning to a camera. - Bugfix: InheritPosition takes the actual camera position, so it works consistently if transitioning mid-blend. +- Bugfix: CinemachineDeoccluder was causing a pop when OnTargetObjectWarped was called. - Added Recentering Target to OrbitalFollow. Recentering is now possible with Lazy Follow - Deoccluder accommodates camera radius in all modes. - StateDrivenCamera: child camera enabled status and priority are now taken into account when choosing the current active camera. diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineDeoccluder.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineDeoccluder.cs index cd589ece6..c39df8337 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineDeoccluder.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineDeoccluder.cs @@ -329,6 +329,14 @@ public override float GetMaxDampTime() : 0; } + /// + public override void OnTargetObjectWarped( + CinemachineVirtualCameraBase vcam, Transform target, Vector3 positionDelta) + { + var extra = GetExtraState(vcam); + extra.PreviousCameraPosition += positionDelta; + } + /// /// Callback to do the collision resolution and shot evaluation ///