File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/BoundingBox Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -946,17 +946,17 @@ private void UpdateBounds()
946946 {
947947 if ( cachedTargetCollider != null )
948948 {
949- Vector3 boundsExtents = Vector3 . zero ;
950-
951949 // Store current rotation then zero out the rotation so that the bounds
952950 // are computed when the object is in its 'axis aligned orientation'.
953951 Quaternion currentRotation = targetObject . transform . rotation ;
954952 targetObject . transform . rotation = Quaternion . identity ;
953+ Physics . SyncTransforms ( ) ; // Update collider bounds
955954
956- boundsExtents = cachedTargetCollider . bounds . extents ;
955+ Vector3 boundsExtents = cachedTargetCollider . bounds . extents ;
957956
958957 // After bounds are computed, restore rotation...
959958 targetObject . transform . rotation = currentRotation ;
959+ Physics . SyncTransforms ( ) ;
960960
961961 if ( boundsExtents != Vector3 . zero )
962962 {
You can’t perform that action at this time.
0 commit comments