• Unity
  • Unity Feature Tutorials



15 jours plus tard

These are very helpful, thanks.

un mois plus tard

@Mitch Using Spine is much better then using Mechanim is Unity. Is there a large overhead in using Spine and importing to Unity rather then directly using Unity's Mechanim. The reason I'm asking this is that I would like to create most of my animation, even non character animations, like environment animation using Spine as it keeps things much more organised.
Thanks

There is certainly some significant overhead. Exporting skinned meshes as FBX and animating them (ie: tree leaves/ vines or something for an environment) would be delegated to GPU Skinning with the native Unity mecanim stuff. Spine all happens in C# and on CPU.

That being said, certain types of animation can be Baked using Spine which convert them to native Unity mecanim type animations and meshes, but still share the same Atlas data as your Spine data. Best of both worlds? Kind of. Maintaining a baked animation is a bit troublesome right now - but it does work.

I personally regularly use Spine as a "rigging" tool for simpler 2D assets and then simply bake them in Unity and let them be driven by 2D Physics or other various dynamics scripts.

@Mitch ok cool. so if I actually dont use skinned meshes for deforming, use Rotate, Position and Scaling only and then Bake the animations inside Unity there shouldnt be any performance overhead I would imagine.

Baking skinned meshes works fine too - so long as you're ok with the limits of 4 bone influences per vertex that Unity imposes. Spine doesn't have that limit. Baking also doesn't let you do per-vertex deformation. Its one big trade off, but ultimately Baked things will run faster because C++ native playback library instead of C#. Baking will also generate a lot more keyframes if you dont use Linear curves as the Unity AnimationCurve works very differently than the Spine Curve.

2 mois plus tard

Ghost Effect

Ragdoll

Submesh Renderers (sandwiching stuff within a SkeletonRenderer model)

14 jours plus tard

Is there a link to download "Ragdoll" project?

I think I included the ragdoll examples in the main unity package and in github

2 mois plus tard

Hello Mitch, i can see in
https://youtu.be/GH6FPr76lU0

Spine Unity SpriteAttacher video in the Footsoldier example that the sprite PNG file "Equipment", can be attach easy and does not create problems, (for example: artifacts...).

Which graphic software used to create the file "Equipment" and export it to Spine?
Can you link some access to the editable file to see the Alpha export options to Spine?

I export the necessary pngs directly from photoshop to Unity in a folder. I use Spine only for skeletons.

I have long been trying how to export my png Sprites to my skeletons via code but still gives me the problem of artifacts and look bad but with the "Equipment" file work fine.

public class load_slot_scr : MonoBehaviour {
   //slots
   public Sprite sprite;   

   [SpineSlot]
   public string slot;

   SkeletonRenderer skeletonRenderer;
   // Use this for initialization
   void Start () {
      //slots
      slot="slot_weapon";
      skeletonRenderer = GetComponent<SkeletonRenderer>();

  var AttachS = skeletonRenderer.skeleton.AttachUnitySprite(slot, sprite);

   }
   void OnGUI(){
      //Button for load sprite
      if(GUI.Button(new Rect(250,250,100,100),"Load Sprite")){
   
sprite = Resources.Load<Sprite>("Resources/Sistema/Maniquis/Sprites/sword"); skeletonRenderer = GetComponent<SkeletonRenderer>(); var AttachS = skeletonRenderer.skeleton.AttachUnitySprite(slot, sprite); }; } }

Sorry for my poor english. :sweat:

The atlas of accessories is generated by Spine's texture packer.

The single sword sprite I assume I exported from Photoshop as TGA with Alpha in that video. However there is a PNG plugin for photoshop that lets you properly export PNG's

http://www.fnordware.com/superpng/

This does the job nicely.

un mois plus tard
Mitch a écrit

...so long as you're ok with the limits of 4 bone influences per vertex that Unity imposes. Spine doesn't have that limit....

Ohhh, so the limit is per vertex not per mesh? A mesh can have many bones as your character needs?

2 ans plus tard

Seems like these tutorials are outdated?
I can't find such SpriteAttacher / AtlasRegion Attacher scrips.

These tutorials are really useful for me, thanks! but I got stuck when I follow your action in tutorial "Spine-Unity Events", in the tutorial 3min15sce, you right clicked the mouse and chose the "Spine->Instantiate(Mecanim)" in the menu,but in my unity editor, I just did not have that option, how I can fix this problem?

Spine runtime 3.6.xx
Unity Version 2017.3.1P4 64-bit