From b4f0cd805b9ba2935d2bb9d3bb51ba6c65cde902 Mon Sep 17 00:00:00 2001 From: tetracup Date: Sun, 13 Apr 2025 21:17:53 +0200 Subject: [PATCH] Fix --- Assets/ChaiTea/Scripts/HapticCylinder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/ChaiTea/Scripts/HapticCylinder.cs b/Assets/ChaiTea/Scripts/HapticCylinder.cs index 6431918..c58d01c 100644 --- a/Assets/ChaiTea/Scripts/HapticCylinder.cs +++ b/Assets/ChaiTea/Scripts/HapticCylinder.cs @@ -16,8 +16,8 @@ protected override void Awake() //Chai3D cylinder position is at bottom //Unity cylinder position at middle - //Apply the offset. - Vector3 offset = new Vector3(0, -this.transform.localPosition.y, 0); + //Apply the offset according to its transform up vector to account for rotations + Vector3 offset = -this.transform.up * this.transform.localScale.y; obj.SetLocalPosition(this.transform.localPosition + offset); }