- Düzenlendi
Black texture when importing to unity
My problem is that when I import the animation files into unity, the material shows up black. The animations still seem work well.
This is the video I followed verbatum
http://www.youtube.com/watch?v=x1umSQulghA
Thanks ahead of time for any help with this matter.
- Düzenlendi
That video is a little outdated. (But still really helpful! I used it too.)
You no longer need rename .json files to .json.txt. Unity recognizes .json as TextAssets now. (Also, you can use an importer to handle renaming .atlas files. Mine is here if you like.)
Make sure your texture is set to "Texture" under Texture Type, and not something else. (It defaults to "Sprite" if you're working in the new 2d mode.)
After assigning your texture to your material, choose the Spine/Skeleton rather than Transparent/Diffuse shader. If you're using something else, you might need to add a light to your scene for it to show up.
Give those a shot and see if it helps.
Edit: Updated Importer URL.
Thanks for the quick answer Chounard!
I can't believe I missed it but it was the fact that I had it under transparent/cutout shader. I changed it to Spine and it is no longer black. Thank you.
This does bring up another problem for me however. Now the camera is having trouble judging the depth of the spine animation against the rest of the transparent/cutouts in the scene. It shows up behind any object with that shader on it, despite the Spine animation being in front.
Any more help anyone can offer would be greatly appreciated.
I'd need more info on how your project is setup. Are you working with an orthographic camera and the new sprite system? If so, toss this script on your spine animations, so you can set the sorting layer/order just like the sprites.
https://github.com/nickgravelyn/UnityTo ... %20Exposed
If not, you might be able to sort it out just using the Z depth to move things in front of others.
Thanks so much again. My coder is looking at the documentation you provided and it is proving to be quite useful.
Our game is actually in perspective. It scrolls left and right like a two way platformer. We really wanted a big 3d feel infused since some of our assets are indeed 3d. It's proving difficult since unity is 3d based (and ortho-friendly for 2d) but we are determined to make it work.
Also, is the Unity "2d toolkit" out? I read about it but wasn't sure if it was released or not. I am downloading 4.3.1 now. (I was a bit behind from working offline from an unusual location)
There's a plugin you can buy called 2d Toolkit which has been out for a long time.
I think you're probably wondering about the 2d sprite system from Unity themselves. Yes, that came with 4.3. It's pretty nice, but not really extensible enough to be used by Spine directly. Luckily, we can mix the Spine renderer with it pretty easily.