It seems like you are experiencing an issue with your character's body flipping unexpectedly when moving in Unity. This could be related to how the flipping logic is implemented in your code. A common approach to flip a character is by adjusting the scaleX
property of the root bone or the skeleton. If the enemy character does not have this problem, it might be due to differences in how the flipping is applied or how the bones are set up in the Spine project.
Here are a few things you can try to resolve the issue:
Check the Flipping Logic: Ensure that the code responsible for flipping the character is correctly implemented. You can use skeleton.FlipX()
or adjust the scaleX
property of the root bone to flip the character. Make sure this logic is consistent with how it's applied to the enemy character.
Bone Inheritance: Verify if any bones have transform inheritance disabled. This can cause parts of the skeleton to not flip correctly. You can check this in the Spine editor and ensure that all necessary bones inherit the correct transformations.
Animation Keys: Ensure that there are no conflicting animation keys that might be affecting the scale or rotation of the bones during movement.
Unity Setup: Double-check the setup in Unity to ensure that the character's skeleton is correctly configured and that there are no additional scripts or components affecting the character's transformation.
If these steps do not resolve the issue, consider providing a minimal reproduction project that demonstrates the problem. This can help in diagnosing the issue more effectively.