Thanks!!! that solved the issue!!!
DunkelBlume

- 8 авг 2024
- Регистрация: 5 ноя 2019
I forgot to mention, I commented those lines cause then it renders the hole and laces on top of Eyes, and I tried the correct way you mentioned, but no different results.
The skeleton is part of the player prefab, which is instantiated via code
GameObject newObject = Instantiate(prefab).gameObject;
And the prefab is in a DontDestroyOnLoad.
And the bug it is very consistent- Player prefab loads on first opened level, al works perfect. Prefab is set to DontDestroyOnLoad,
- When player finishes level the system loads asyncronously another scene(Room/lobby).
- when the new scene is loaded it notifies the prefab and it reloads character customization. Character looks normal, no problems with the eyes and hoodie
- when player selects and enters the next level, it loads async
- when the new scene is loaded it notifies the prefab and it reloads character customization, but now character doesn't show the eyes and sometimes doesn't show the hole and laces.
Now, during gameplay there are some animations that deactivate/activate the problematic attachments
Or maybe there's a cache that needs to be cleared?
Harald
Hi, so yeah. This is the code I use to load character customizationpublic void LoadPlayerCustomization() { Skin newSkin = new Skin("new-random-skin"); // Skin color if (characterCustomization.SkinColorSkinName != null && characterCustomization.SkinColorSkinName != "") newSkin.AddSkin(introvertSkeletonData.FindSkin(CharacterCustomizationSkinsPrefixes.SkinColorPrefixes + characterCustomization.SkinColorSkinName)); if (DragonTailObject != null) { if (characterCustomization.HoodieSkinName.Contains("Dragon")) { if (!isCutsceneCharacter) { DragonTailObject.SetActive(true); IsDragonTailActive = true; } else { newSkin.AddSkin(introvertSkeletonData.FindSkin(DragonTailSkinName)); } } else { IsDragonTailActive = false; DragonTailObject.SetActive(false); } } // Bottoms newSkin.AddSkin(introvertSkeletonData.FindSkin(CharacterCustomizationSkinsPrefixes.BottomsPrefixes + characterCustomization.BottomsSkinName)); // Hoodie newSkin.AddSkin(introvertSkeletonData.FindSkin(CharacterCustomizationSkinsPrefixes.HoodiePrefixes + characterCustomization.HoodieSkinName)); // Feet newSkin.AddSkin(introvertSkeletonData.FindSkin(CharacterCustomizationSkinsPrefixes.FeetPrefixes + characterCustomization.FeetSkinName)); // Accesories if (characterCustomization.AccessoriesSkinName != null && characterCustomization.AccessoriesSkinName != "") { newSkin.AddSkin(introvertSkeletonData.FindSkin(CharacterCustomizationSkinsPrefixes.AccessoriesPrefixes + characterCustomization.AccessoriesSkinName)); } // Power ups if (characterCustomization.PowerUpSkinName != null && characterCustomization.PowerUpSkinName != "") { newSkin.AddSkin(introvertSkeletonData.FindSkin(CharacterCustomizationSkinsPrefixes.PowerUpPrefixes + characterCustomization.PowerUpSkinName)); } // Default skin hold the hoodie hole, laces and the eyes //newSkin.AddSkin(introvertSkeletonData.FindSkin(CharacterCustomizationSkinsPrefixes.defaultSkin)); characterSkeleton.skeleton.SetSkin(newSkin); characterSkeleton.skeleton.SetSlotsToSetupPose(); }
Some more info:
No draw order keyed
No blending for the hole and laces
Attachments are active by default, deactivated/activated in the animations only
The skeleton is in a DontDestroyOnLoad. We load scenes async and trigger an event to notify stuff that player has "respawn". The Skeleton also listens to this and reloads character customization.The weird thing is that when this bug appears, it also bugs the skeleton asset in unity editor as shown in the gif.
And recently I found that clicking the reload button of the skeleton in the inspector, reactivates the eyes, but! I don't know how to do that on runtime by code
Hello! I need help, I'm having a weird behavior in the a skeleton. We have character customization, so we created many skins in one 4k atlas, in unity, through code I load the default or player's character customization changing the skeleton skins.
First time in level, it all looks normal(img 1). But as soon as player goes to lobby, then back to a mission on another level the skeleton either stops rendering the eyes or maybe it is rendering them in behind the hoodie?(img 2)Every time the character spawns / respawns it loads the customization.
we have the default skin, which is the hoodie hole and laces and eyes, then we have folders to organize the rest of the skins, Bottoms (all pants, shots, skirts),hoodies, etc..
The weird part is that when this bug appears in game, it also affects the skeleton in unity, so, in the editor preview, I cannot see the eyes and hoodie hole either.Do you have an idea of what could be causing this?
We've tested setting the default as the last skin but it renders the hole over the eyes(img3), we are also exploring to check if there's a skin that might be overwriting the eyes and hole, but this doesn't seem to be the caseThanks!
Hi Herald, nope, the skeleton is already in the scene, with an idle animation (this doesn't change) and Starting loop option ticked
We solved it!!! :greatsuccess:
So... we were trying to use the slot before Spine finished the initilialization,
we used theSkeletonGraphic.Initialize(false);
to wait until this was done and then make use of them.
- Изменено
Hi!
I'm running into a Null Reference when I try to get the attachments of a slot from a skeleton when running into a mobile device. Do you guys know if I need to initialize (or wait for) something before attempting to find the slot and its attachment?
My skeleton has several slots and I use this line to get the attachmentAttachment currentSlotOff = MyAsset.Skeleton.FindSlot(SlotName + "Off").Attachment;
Attachment currentSlotOn = MyAsset.Skeleton.FindSlot(SlotName + "On").Attachment;
I'm using C# in unity and a SkeletonGraphic.
Steps
- I have the SkeletonGraphic already on the screen.
- When initializingthe asset that uses this skeleton, I try to get the slot and the attachement
- I get a null reference, but only on the mobile build never on Unity's Editor
Thank you for your help!
Thanks Harald! we'll work on that.
Done!!
and yes the error occurs when I drag them into scene to instantiate it.Thanks a lot!! Harald
Hi Harald!
No problem I appreciate your response!
I'm using spine-unity-3.8-2019-08-23.unitypackage
I got the files thru git and When I move the files (which are 6) to another folder no error is thown.
If I add those 3 files exported from spine I get no error but this message
As for the preview, this asset has only default skin and several animations, so de default pose the asset is hidden however If I choose an animation I can see it
Thanks a lot for your time!
- Изменено
Hi,
I hope you guys could help me here, I'm having an issue with an asset when I place it as Graphic Skeleton; Spine throws a null reference exception at MeshGenerator and it keeps stacking until I select a start animation.
And! if I turn on the gameobject by code at runtime I get the same exception again.
We are using spine 3.8.75
Does any one knows what could be wrong with my asset?
Thanks!