As a slot's blending is additive, it makes another spine which is behind it disappeared.
It only happens in a few mobiles. it is no problem when on computer
Here's one of a player's feeback. Maybe help
(sword slash's blending is additive in spine)
"but devs there's a bug with the sword animation. The attack somehow Masks enemies but i can see the level through it. But enemies literally dissapear behind the sword animation. However, attacking behind an enemy is fine and the enemy stays visible. This bug also makes boss attack animation hard to see!"
a visual bug in unity
@enjack Sorry to hear you're having troubles. Unfortunately it's very hard to diagnose from text alone.
Which exact version of the spine-unity runtime (name of the unitypackage, also listed in Assets/Spine/version.txt
or in the Package Manager) are you using?
Which skeleton components are you using at the problematic skeletons? SkeletonAnimation
or SkeletonGraphic
?
What are your material settings and shaders used, especially at the special slot-blend-mode sword item?
Could you please show some screenshots of your character and scene setup, especially showing Material settings, and how your slot blend mode material assignment is setup in the Inspector?
- Edited
- spine-unity runtime version is "This Spine-Unity runtime works with data exported from Spine Editor version: 4.1.xx Package version: spine-unity-4.1-2022-07-28.unitypackage"
spine version is 4.1.23 - Skeletonanimation
3.here is the material settings, the project requires "write to depth", and it is URP project.
It only happens in a few devices. Most devices dont have this problem.
enjack spine-unity runtime version is "This Spine-Unity runtime works with data exported from Spine Editor version: 4.1.xx Package version: spine-unity-4.1-2022-07-28.unitypackage"
Please note that your spine-unity package is already a year old and there have been 88 commits of bugfixes and improvements since then. We would highly recommend updating the spine-unity runtime first when encounting any issues. As always, be sure to backup your project first.
enjack 3.here is the material settings, the project requires "write to depth", and it is URP project.
In general it is not recommended to use non-URP Spine shaders with URP, even when it's unlit shaders. Similarly, there are known issues especially on mobile devices when incorrectly using a URP shader with SkeletonGraphic
, so I would not be surprised if using a non-URP shader with the URP pipeline yields problems as well.
In general there is the Universal Render Pipeline/Spine/Skeleton
shader available for unlit purposes, which has been added after your used spine-unity package version, so you will need to update the package first to use this shader.
I assume the only feature you require from the Spine/Sprite/Unlit
shader is the Write to Depth
feature, is this correct? If so, you could easily create a copy of the Universal Render Pipeline/Spine/Skeleton
shader, modify its name and replace occurances of ZWrite Off
with ZWrite On
(it occurs twice in the shader).
But enemies literally dissapear behind the sword animation.
This sounds as if perhaps the shader of the sword effect uses a different shader than Spine/Sprite/Unlit
. When the sword effect is visible, do you see just a single Material used at the selected GameObject in the Inspector? Or do you perhaps see a second Material used, like e.g. a Material with an additive shader?
If you could also perhaps share a screenshot of the incorrectly applied effect, that would help a lot as well.
@enjack It looks like it's really only using a single material. I assume the slot blend mode at the effect's slot is Normal
, is this correct?
If it uses only a single material, then draw call reordering cannot be the problem, since then your skeleton will be rendered in a single draw call. It might be that the used shader is not supported on all your test devices and that it fails to load on your low-end-devices, and thus uses a fallback shader instead which causes the problems (e.g. by rendering in the non-transparent queue in front to back sorting).
If it's using a single material, I would recommend switching from the Spine/Sprite/Unlit
shader to a copy of the Universal Render Pipeline/Spine/Skeleton
modified with enabled ZWrite
as described earlier:
Harald I assume the only feature you require from the Spine/Sprite/Unlit shader is the Write to Depth feature, is this correct? If so, you could easily create a copy of the Universal Render Pipeline/Spine/Skeleton shader, modify its name and replace occurances of ZWrite Off with ZWrite On (it occurs twice in the shader).