X Tutup
Skip to content

Commit 5dfef4f

Browse files
committed
Ensure that bones only have a z rotation, not x or y when they are placed between two joints. Otherwise it can mess up the decoration orientation and positioning.
1 parent e05c8c3 commit 5dfef4f

File tree

1 file changed

+2
-0
lines changed
  • Assets/Scripts/Creature/Body

1 file changed

+2
-0
lines changed

Assets/Scripts/Creature/Body/Bone.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ private void PlaceBetweenPoints3D(Vector3 start, Vector3 end, float width) {
140140
transform.position = position;
141141
transform.up = offset;
142142
transform.localScale = scale;
143+
float eulerRotation = transform.rotation.eulerAngles.z;
144+
transform.rotation = Quaternion.Euler(0, 0, eulerRotation);
143145
}
144146

145147
/// <summary>

0 commit comments

Comments
 (0)
X Tutup