- Изменено
Spine not showing on the UI
Hello,
I am working on a Health bar on the Unity UI, and I have an FX Spine that shows every time the character gets hit. The thing is, even though I have other Spine pieces in the same Canvas, this one is not visible. Although if I place the Spine in the world as a SkeletonAnimation instead of the canvas, the Spine is visible.
The hierarchy looks like this. The main parent has a Canvas Group, and Spine_boss_energy_bar is another Spine that does work as expected, and the setting is the same, so I guess the problem might be on the Spine itself?
This is how the component looks like ↓
Does anyone know what could be happening?
Thanks in advance!
Does this problem also occur if you create a new canvas and drag-and-drop instantiate the same SkeletonDataAsset as a child of this canvas?
Did you try hitting the Match RectTransform with Mesh
Match
button? This fixes the problem of the RectTransform bounds being too small and potentially outside of the parent clipping area.
Hello, Harald. Thank you for your response.
I tried the Match with RectTransform button indeed, I saw some recommendations on other threads, but that didn't solve the issue.
I just tried what you suggested about dragging it to a new canvas and the result is the same, the SkeletonGraphic keeps being transparent.
I am so lost with this T_T
You could switch the Shading Mode
in the Scene
window from Shaded
to Shaded Wireframe
so that you can see if any triangles are drawn at all, after hitting F
with the SkeletonGraphic GameObject selected to focus (or frame) the scene view on it.
You could also have a look if scaling it by 100 or 0.01 changes anything.
If all of the above show nothing, could you please send us the three exported asset files of the problematic skeleton? You could attach it to the posting or send it as a zip package to contact@esotericsoftware.com.
Harald написалYou could switch the
Shading Mode
in theScene
window fromShaded
toShaded Wireframe
so that you can see if any triangles are drawn at all, after hittingF
with the SkeletonGraphic GameObject selected to focus (or frame) the scene view on it.You could also have a look if scaling it by 100 or 0.01 changes anything.
If all of the above show nothing, could you please send us the three exported asset files of the problematic skeleton? You could attach it to the posting or send it as a zip package to contact@esotericsoftware.com.
Hi Harald,
switching the Shading Mode to Shaded Wireframe shows that the spine does not have any triangles like other Spines I have do. Scaling it has no effect.
Attached you can find the 3 assets exported from Spine.
Thanks again.
Thanks for sending the repro asset!
It seems that it can be solved by disabling Cull Transparent Mesh
at the SkeletonGraphic's CanvasRenderer
component.
Harald написалThanks for sending the repro asset!
It seems that it can be solved by disabling
Cull Transparent Mesh
at the SkeletonGraphic'sCanvasRenderer
component.
Wow that really did the thing, thanks a lot!
Can you explain to me how that works? When should I disable that?
Also is this incompatible with the CanvasGroup material? When I set that material I got it transparent again...
https://docs.unity3d.com/ScriptReference/CanvasRenderer-cullTransparentMesh.html
So you should disable this when setting any slot to blend mode Additive
and having PMA Vertex Colors
enabled (to apply an additive slot via PMA additive blending in one drawcall with normal blend mode). Anything that turns vertex alpha to 0 although not being transparent causes problems with this option enabled.
Canvas group behaviour is independent of the Cull Transparent Mesh
parameter. See the documentation lines here, under Canvas Group Tint Black
:
spine-unity Runtime Documentation: Parameters
And section 9. Spine/SkeletonGraphic Tint Black
in this shaders documentation section:
spine-unity Runtime Documentation: Shaders