AHAKuo

- 19 авг
- Регистрация: 3 мар 2021
- Изменено
Hi Spine Team,
I'm using Spine 4.2 (4.2.43) with the Spine-Unity 4.2 runtime (spine-unity-4.2-2025-08-07.unitypackage) and encountering an issue where animation events are not cleared in Unity after being removed in Spine.
Steps to Reproduce:
- In Spine 4.2, create an event named "AnimationEvent" with the value "test" and place it on an animation.
- Export the animation to Unity.
- Verify the event appears in Unity's AnimationClip.
- In Spine, remove the "AnimationEvent" event from the animation.
- Re-export to Unity.
- Check the AnimationClip in Unity—the event with value "test" still exists.
Observation:
The issue seems related to the fix in commit edea4bef, where events with the value "SpineEvent" are cleared, but others (like "test") persist. I discussed this before in forum post 25327 (https://en.esotericsoftware.com/forum/d/25327-spine-unity-runtime-not-clearing-old-events).Can you confirm if this is a known issue in the 4.2 runtime and suggest a fix or workaround? Thanks!
EDIT: EsotericSoftware/spine-runtimes1838
I looked at the ticket, and it seems that user events aren't properly cleared.
Using: spine 4.0.64
Runtime: spine-unity 4.0 2022-09-26I can't update to latest version 4.1 because my project in Unity is too deep and the processes are too strict already, so I can't update without breaking everything.
The problem:
I use the spine events to setup my animation events in Unity
If I remove the animation event from spine and export again to the same directory in unity:
Unity updates everything (I see it in console changes):
But the removed animation event stays:
This ruins the process I used to have on the runtime version (spine-unity-4.0-2021-08-12). That version used to clear removed events and properly sync up everything.
I, thankfully, reverted to the old version mentioned above, but I had to let you know about this.
- Изменено
Hi there, I'm developing a game in which the main character has two modes. A small size, and big size (check photo). And in both of them, the animations are all the same name, all the same parameters and the same code controls them.
I have achieved the switch I'm looking for, but it causes a small spike in performance each time it is called, and I'm wondering if there's a way to do it better without the performance loss.
Preview:
The code I'm using to make it work is this:
if (playerInput.Spider()) { if(skeletonMecanim.skeletonDataAsset == BigNeon) { skeletonMecanim.skeletonDataAsset = SmallNeon; skeletonMecanim.Initialize(true); animator.runtimeAnimatorController = animatorControllerNeonSmall; } else { skeletonMecanim.skeletonDataAsset = BigNeon; skeletonMecanim.Initialize(true); animator.runtimeAnimatorController = animatorControllerNeonBig; } }
Any help is appreciated!
I am using unity engine version 2020.3 LTS.
And spine-unity-3.8-2020-10-28 runtime.
I keep having these problems whenever the SkeletalMecanim Script is either expanded in the inspector or if I select an object that has a skeletalmecanim script.
They aren't problems per se, but working in the editor is nearly impossible with all of these messages constantly popping up on my face.
This only happens with the skeletalmecanim objects. Anything else I select is fine.
The messages pop up and keep popping up as long as the script is expanded. If I collapse the script, the messages stop.
This didn't happen before with the older version of unity.
- Изменено
Hi there, I have decided to change my game's render pipeline to 2D Lights, however, I don't know how to make the spine skeletons (i.e. mesh renderers or the materials) work with the 2D Lights.
I have upgraded the scene to use 2D lights, and all sprites got updated properly. How do I make the spine skeleton materials work as well?
Is there a shader I'm supposed to use?
Thank you. And please forgive me if I seem lost. I've never dealt with shaders before.
Ok! I've fixed it.
I just changed the shader to UniversalRenderPipeline/2D/Sprite Default Unlit
- Изменено
Hello there! I have a simple mechanic I'm trying to achieve. In my game, there are butterflies that follow the characters wherever they go. And I want to achieve the "following feeling" rather than having them fixed over the characters.
I could simply create a MoveTowards script and have the transfrom follow the character, but I want the butterfly to follow the bone itself. Because in some animations, the character can move away from the center.
TL;DR So, I've been trying to modify the BoneFollower script into making it use Vector2.MoveTowards. Rather than having it fixed over the bone.
How can I do that?
Here's what I attempted:
public void LateUpdate () { if (!valid) { Initialize(); return; } #if UNITY_EDITOR if (!Application.isPlaying) skeletonTransformIsParent = Transform.ReferenceEquals(skeletonTransform, transform.parent); #endif if (bone == null) { if (string.IsNullOrEmpty(boneName)) return; bone = skeletonRenderer.skeleton.FindBone(boneName); if (!SetBone(boneName)) return; } Transform thisTransform = this.transform; if (skeletonTransformIsParent) { // Recommended setup: Use local transform properties if Spine GameObject is the immediate parent thisTransform.localPosition = new Vector3(followXYPosition ? bone.worldX : thisTransform.localPosition.x, followXYPosition ? bone.worldY : thisTransform.localPosition.y, followZPosition ? 0f : thisTransform.localPosition.z); if (followBoneRotation) { float halfRotation = Mathf.Atan2(bone.c, bone.a) * 0.5f; if (followLocalScale && bone.scaleX < 0) // Negate rotation from negative scaleX. Don't use negative determinant. local scaleY doesn't factor into used rotation. halfRotation += Mathf.PI * 0.5f; var q = default(Quaternion); q.z = Mathf.Sin(halfRotation); q.w = Mathf.Cos(halfRotation); thisTransform.localRotation = q; } } else { // For special cases: Use transform world properties if transform relationship is complicated Vector3 targetWorldPosition = skeletonTransform.TransformPoint(new Vector3(bone.worldX, bone.worldY, 0f)); if (!followZPosition) targetWorldPosition.z = thisTransform.position.z; if (!followXYPosition) { targetWorldPosition.x = thisTransform.position.x; targetWorldPosition.y = thisTransform.position.y; } float boneWorldRotation = bone.WorldRotationX; Transform transformParent = thisTransform.parent; if (transformParent != null) { Matrix4x4 m = transformParent.localToWorldMatrix; if (m.m00 * m.m11 - m.m01 * m.m10 < 0) // Determinant2D is negative boneWorldRotation = -boneWorldRotation; } if (followBoneRotation) { Vector3 worldRotation = skeletonTransform.rotation.eulerAngles; if (followLocalScale && bone.scaleX < 0) boneWorldRotation += 180f; thisTransform.SetPositionAndRotation(targetWorldPosition, Quaternion.Euler(worldRotation.x, worldRotation.y, worldRotation.z + boneWorldRotation)); } else { thisTransform.position = Vector2.MoveTowards(thisTransform.position, new Vector2(targetWorldPosition.x, targetWorldPosition.y), 7f ) ; } } Vector3 localScale = followLocalScale ? new Vector3(bone.scaleX, bone.scaleY, 1f) : new Vector3(1f, 1f, 1f); if (followSkeletonFlip) localScale.y *= Mathf.Sign(bone.skeleton.ScaleX * bone.skeleton.ScaleY); thisTransform.localScale = localScale; }
It still doesn't work. On the parameters of the script, I only have "FollowXYPosition" set to true.
This is the line I edited in the script:
[b] thisTransform.position = Vector2.MoveTowards(thisTransform.position, new Vector2(targetWorldPosition.x, targetWorldPosition.y), 7f )[/b]
Can you please help? Thank you
- Изменено
- Изменено
Hi there!
I've been using Spine2D to animate my game for quite a while now. Such an awesome tool! And the runtime for unity is really straightforward and easy.
I just figured out that in order to have an animation transition to another one seamlessly without any snapping, I have to key the same bones and meshes that were keyed at the end of the previous animation at the beginning of the second one. And when I found that out, I immediately went ahead and started keyframing all meshes and bones at the first second as empty keyframes to allow this transition to happen in Unity. And viola! All the animations blend very nice now.
But when I have the animation clean up tool on during export, it deletes all the empty keyframes, and in turn, that makes the transitions in the game have some snapping parts. Like, some parts of the animation would transition ok, but the rest would snap, and that is because the start empty keyframes were deleted.
I don't want to have to disable the Animation Clean Up tool, as it can delete "middle" empty keyframes that don't really serve any purpose. Is there a way to have the clean up exclude the first second?
Thank you in advance!