Xelnath

NullReferenceException: Object reference not set to an instance of an object
Spine.Unity.SkeletonRenderer.LateUpdate () (at Assets/External/spine-unity/Assets/spine-unity/SkeletonRenderer.cs:699)
// CheckIfMustUpdateMaterialArray (last pushed materials vs currently parsed materials)
// Needs to check against the Working Submesh Instructions Materials instead of the cached submeshMaterials.
{
var lastPushedMaterials = this.sharedMaterials;
bool mustUpdateRendererMaterials = mustUpdateMeshStructure ||
(lastPushedMaterials.Length != workingSubmeshInstructions.Count);

if (!mustUpdateRendererMaterials) {
var workingSubmeshInstructionsItems = workingSubmeshInstructions.Items;
for (int i = 0, n = lastPushedMaterials.Length; i < n; i++) {
if (lastPushedMaterials[i].GetInstanceID() != workingSubmeshInstructionsItems[i].material.GetInstanceID()) { // Bounds check is implied above.
mustUpdateRendererMaterials = true;
break;
}
}
}
workingSubmeshInstructionsItems[i].material is null.
Xelnath
記事: 407

Pharan

Can you describe your setup more?
An error here likely means one of your materials went missing outside of Spine's system.
アバター
Pharan
記事: 5366

Xelnath

Sure, uhm, in a nutshell, I have spine object which is a child of another object. When the parent is destroyed, this error appears.
Xelnath
記事: 407

zeuxgame

I have this too
if your animation at first frame don't assign any image to slot
runtime will think the animation don't need material
so the materials in MeshRenderer at this time is empty
this will happen randomly when switch animation
hope this can be fix
or our animators need to check every animation at first frame have image or not

by the way
I found a ghost bug happen when you back to editormode from play
the ghost script will throw some null reference
zeuxgame
記事: 20

Pharan

Thanks for also reporting with repro steps @zeuxgame.

Can you post a new topic and an error log for that other bug?

I think I've found the problem for your case. Possibly also fixes Xelnath's case. Will post the fix in a bit.

EDIT:
To apply this fix immediately, please open your SkeletonRenderer.cs file and replace its contents with this: https://raw.githubusercontent.com/EsotericSoftware/spine-runtimes/master/spine-unity/Assets/spine-unity/SkeletonRenderer.cs

This change will be included in the next .unitypackage update.
アバター
Pharan
記事: 5366

Xelnath

Thanks, Pharan :)

Having some issues preventing me from testing the original use case that caused the error. Will report back when I fix those!
Xelnath
記事: 407


Return to Unity