You are right, I was planning to make a slow-motion video, but you were faster to respond.
Indeed skeleton.UpdateWorldTransform();
was the missing part.
Thanks a lot.
You are right, I was planning to make a slow-motion video, but you were faster to respond.
Indeed skeleton.UpdateWorldTransform();
was the missing part.
Thanks a lot.
True, they are not aligned in this example, but this is not the point.
The issue is which skeletons are being shown during turning (specially from right to left).
The "sprite" example uses the same images, and as you can see, it is fine.
I am making an 8-directional movement, using 5 directions, where Left mirrors Right (and UL/DL mirror UR/DR).
Each of the base 5 directions is a separate Spine project, each it has its own animations e.g. "idle" and "walk".
And they are combined by a parent GameObject:
The parent has an animator, where it has a state for each direction:
Each one is associated with a script to iterate over children and enable/disable the MeshRenderer
s accordingly (far below).
With Spine, during the switch from right to left (using a tool called AdventureCreator
), the animation incorrectness is detected by the eyes, even with simple skeletons with one image and no animation, e.g. which clicking on left, the right direction is shown for very short period of time.
4 directions:
8 directions:
I tested the same scenario with simple images, with the same Controller and same script (using SpriteRenderer
instead), and the movement is smooth:
I was able to fix it with Spine, by duplicating the right directions, and not changing the scaleX
programatically, but I feel this is more of a workaround, and it means the character will always move with 8 skeletons instead of 5.
My questions are:
Thanks a lot,
public class SpineAnimationScript : StateMachineBehaviour
{
public string animationName;
public string direction;
public override void OnStateEnter(Animator animator, AnimatorStateInfo
stateInfo, int layerIndex)
{
foreach (Transform t in animator.gameObject.transform)
{
var go = t.gameObject;
var reversed = direction.EndsWith("L") && go.name == direction.Substring(0, direction.Length - 1) + "R";
var visible = reversed || go.name == direction;
if (go.GetComponent<MeshRenderer>()) {
var anim = go.GetComponent<SkeletonAnimation>();
anim.skeleton.ScaleX = reversed ? -1 : 1;
go.GetComponent<MeshRenderer>().enabled = visible;
}
else
{
go.GetComponent<SpriteRenderer>().flipX = reversed;
go.GetComponent<SpriteRenderer>().enabled = visible;
}
}
}
}
Steps:
Create new Unity 2019.4.3.f1
Project
Asserts -> Import package -> Customer Package -> spine-unity-3_7-2019-08-05
Import all
In Project window -> Assets -> Spine Examples -> Spine Skeletons -> Spineunitygirl
Select Doi_SkeletonData
In Preview: click on "blink" or "main" animation
Expected: the animation is shown
Actual: the girl is not moving
This is working with spine-unity-3.8-2020-07-10
, but not with 3.7
Also, in both versions, there is a warning:
Class SkeletonExtensions can not exist in multiple namespaces in the same file, even if one is excluded with preprocessor directives. Please move these to separate files if this is the case.
Hi Rajesh,
I didn't fully understand the breakdown of the 240$, specifically (thumbnail and color option and process). Does it include character design from scratch? Since I am building MVP, I am fine with simple character design, but I want attractive animation.
I also feel like you are specialized in animation, do you know someone to design a character or we can just get a sample from the internet and work on it?
Since I also need other characters, let's try with something: The first girl on the right in https://www.dreamstime.com/stock-illustration-back-to-school-cute-kids-go-to-school-vector-set-diverse-different-nationalities-white-background-image96934126
Let's say it needs to be rigged and animated in 5 directions (up, up-right, right, lower-right, down), since the others are mirror of those 5. Plus blink animation. Cloths should be a "skin" so it can be changed later.
How much would it cost?
Another thing: if I want to have a character of a boy similar to the SpriteUnityGirl (https://github.com/EsotericSoftware/spine-runtimes/tree/3.8/spine-unity/Assets/Spine%20Examples/Spine%20Skeletons/Spineunitygirl), how much would it cost to design it?
Thanks.
Hi Rajesh,
Thanks for reaching out. Your work speaks for itself.
At the moment, someone else is starting the project, however I may need your help later.
I have two questions to ask you:
- Other than the animation, do you design characters? Or I should have a rigged character before hand. Also, to make 8 (actually 5) direction pose, do you need the character in many poses, or you only one is enough.
Thanks.
Hi all,
I want to have an 8 direction 2D animation to be used in Unity.
Background:
Character design:
Animations:
Expected delivery:
Project folders
Nice images (for further discussions):
https://www.pngegg.com/en/png-byokv
Simple cloths (but too big head)
https://www.nicepng.com/ourpic/u2e6q8t4e6t4y3r5_2d-character-design-wassermolekl/
Cartoon characters
http://tamil-nadu.freeadsinindia.in/content/root/users/2017/20170727/u847272/images/201707/f20170727122007-character-design.jpg
P.S.: for some reason I am not allowed to use URL BBcode
Hi all,
I am new to everything but coding
Is it possible to change the character cloths are runtime in unity, e.g. wearing T-shirt instead of pajama, and how to do that?
Thanks.