Followers takes gameobject rotation into account.

This commit is contained in:
Davide Tantillo 2026-03-17 17:28:40 +01:00
parent a20d61ff50
commit 5f3c7c0a4d

View File

@ -903,6 +903,7 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
const sin = Math.sin(boneGameAngleRad); const sin = Math.sin(boneGameAngleRad);
const negateAngle = this.isMirrored !== this.isFlipped; const negateAngle = this.isMirrored !== this.isFlipped;
const gameObjectAngleDeg = (this.angle + this.propOffsetAngle) * spine.MathUtils.radDeg;
for (const follower of followers) { for (const follower of followers) {
const instance = this.runtime.getInstanceByUid(follower.uid) as IWorldInstance; const instance = this.runtime.getInstanceByUid(follower.uid) as IWorldInstance;
@ -918,7 +919,7 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
instance.y = y + rotatedOffsetY; instance.y = y + rotatedOffsetY;
const angle = boneRotation + follower.offsetAngle; const angle = boneRotation + follower.offsetAngle;
instance.angleDegrees = negateAngle ? -angle : angle; instance.angleDegrees = gameObjectAngleDeg + (negateAngle ? -angle : angle);
} }
} }
} }