- تم التحرير
Unity + IK + SkeletonUtilityGroundConstraint problem
Hello, Im new in Spine, I have a problem implementing SkeletonUtilityGroundConstraint.cs.
I dont know why but when I press play the IK bones with SkeletonUtilityGroundConstraint.cs begins falling from above there is a way to fix that?.
Here is a video of my problem:
someone could help me? I would be very grateful.
PS: sorry for my English, is not my mother language.
Thanks
21 Nov 2015, 16:03
I have noticed that when you increase the value of "Adjunts Speed" in the SkeletonUtilityGroundConstraint.cs then at least the "IK object" fall faster on the floor, but really what I'd like is that "IK object" directly appear in the correct position bone on the floor and not to fall from the sky
It doesn't look like there's anything wrong with the settings or setup.
But judging from the gizmo, it looks like there's actually something there it's colliding with, at least for one frame at the very beginning.
The Adjust Speed
of 5 is consistent with the way it falls. Setting the adjust speed
to around 60 will make it fall immediately, but I'd be more concerned about the thing it was colliding with in the first frame. Because you'll notice this falling movement DOESN'T happen with the Raptor Ground Constraint sample.
Try pressing pause
, before pressing play
. So that the game starts in a paused state.
And examine the Hierarchy and Scene view. Look for any object it might be colliding with.
Hi Pharan, now I try with a complete empty scene, only with the character.. but I still have the same problem.. I mean the IK objects with SkeletonUtilityGroundConstraint.cs still falling from the sky..
anything else that could be causing this?
That's hilarious. The cast distance is 5 but it went 100 units up in the air.
This was higher than the one in your non-empty scene.
What changed? Is something repositioning your character? Are you scaling your character down?
I'll show this to Mitch (the person who made SkeletonGroundConstraint) and see what he thinks. This is really weird, but I can't seem to reproduce it.
I have scale but by the SkeletonData, look: Image removed due to the lack of support for HTTPS. | Show Anyway
SkeletonData scale should be harmless.
I'll wait to hear back from Mitch. Meanwhile, I'll try to investigate further.
I think I found the problem, it seems that when the object with SkeletonUtilityGroundConstraint.cs have a negative value in Y is when the case occurs, look:
Pharan, you think that is a bug? or is working as it should?
anyway I think I can keep this up putting all my platforms with a Y value above the negative =P
Image removed due to the lack of support for HTTPS. | Show Anyway
Good catch! I think it's a bug. That's definitely not how it's supposed to work!
Here's a fix for now.
Open SkeletonUtilityGroundConstraint.cs
Replace the OnEnable
method with this:
protected override void OnEnable () {
base.OnEnable();
lastHitY = transform.position.y; // Add this line.
}
Let us know if this fix works or if you run into any more problems! Thanks! I'll wait for Mitch and see if he has anything to say.
Oh! Nice.. Thanks you Pharan..
A question, which is the software you use for generate the animated gif? =P
Thanks!
GifCam.
I hear ShareX is good too.
Did it work?
Hi Pharan, now I have test and is working with your fix..!
Thanks
I have a simliar problem. The foot will not combe back down again. It jumps up (not smootly) and then it does not drop down to the initial position.
I testet the same with the raptor spine demo project (which should represent this case) and it won't work there also (but here it does not jump up immediately but does not come back down). Maybe a problem with the version?
Just checked it on both 3.4 and 3.5.
Seems to be working fine.
Check your layer settings on your relevant colliders and the constraint.