We find the “Spine Person” component in the object inspector and set the settings, as shown in the figure below. Remains the binding of objects to the bonesįor the test, you can use the prefabs “fx1_pref” and “fx2_pref” from the folder “ExampleEffects”. However, in order for the animation to turn on automatically, do not forget to set similar settings in the component shown in the image below (“Time Scale” is reduced for clarity).
We pull it out onto the stage, press “Play” and watch the animated ghost. As a result, we have a folder with the name specified during import, containing resources and a prefab called “animation”. In the process of creating and linking the necessary prefabs, several error messages may appear in the Unity console, but they do not affect the final result. By clicking this button, the import of the animation is completed.īy the way, the MaxRectsBinPack script, with a small add-in, was used to create the atlas. Since all imported animations will be stored in one place, the name must be unique, otherwise the window will show a warning at the bottom instead of the “OK” button. The upper field “Set person name” also matters. And “Max texture size” sets the texture quality in Unity, the maximum value is also recommended. "Max atlas size" exists only for debugging, there always needs a maximum value. The “Padding” field defines the gap between the textures in the atlas, with a value of 1 artifacts did not occur. In the "Pack method" field, select the most optimal option, i.e. As a result, we see the generated atlas and a couple of settings, as in the figure below. Unzip it and drag the resulting folder into the large field "> Drag the folder export character here.
Now we need the “necr_2.zip” file, it contains the export of animation from the Spine project. To open the import window in our Unity project, you need to find the “Window” item in the top menu and select “Spine Import Window” in the drop-down list, as shown in the figure below.Īs a result, we will see a similar window: In this scene, an animated ghost flies in front of the camera with an effect attached to one of the bones of the hands, if you can call it that. In the resulting project, you can open and run the finished scene, it lies in the “ExampleEffects” folder. Now create a new 2D project in Unity, import the “2D Toolkit” package and the contents of the “spine_test.unitypackage” file into it, which can also be downloaded at the end of this article. If the source of the animation for some reason is not desirable to transfer along with the folder, then this is not important, the file “*. The finished export folder with the source is in the “necr_2.zip” archive, which can be found at the end of this article.
UNITY AND SPINE2D PLUS
Next, specify “ / Export” as the path, and click the export button.Īs a result, we have the Spine project folder with what was already there, plus the necessary JSON file. It is important here not to forget to indicate that we DO NOT need an atlas when exporting (the "Create atlas" field). Export settings are shown in the figure below. In addition to this, we will also need the JSON file generated by the editor during export. The process of creating animations will not be described here, on the developer's site there is excellent documentation on this subject.Įach Spine project is actually a folder with used images and a file with project settings (*. Therefore, a window was written for import into which it was enough to drag the animation export folder from the Spine editor and click “OK”. Importing animations from the Spine editor manually is described in a simple video instruction, however, in the case when several people are working on a project, this can cause some difficulties. Csharp library, which can be downloaded here (but it already exists in the attached project).
UNITY AND SPINE2D FREE
Free version of the Unity editor (v 4.5.3f3 at the time of writing).So, what will be needed to implement the plan: Īt the end of the article, ready-made animation and a test project are attached, the result of which will look something like this: Let's look at an example of a particle system available in the Unity editor.
UNITY AND SPINE2D HOW TO
Here we will describe how to simplify the import of Spine animations into a Unity project, and what needs to be done to bind an arbitrary object (visual effect, collider, etc.) to the animation itself or its individual bones.