- Изменено
Problem with skins and constraints in libgdx
I am trying to enable a skin which contains a few bones and constraints, I have this code to enable the skin:
skeleton.setSkin("testskin");
skeleton.setToSetupPose();
state.apply(skeleton);
but the all the bones in the skin are placed completely in the wrong position and the constraints don't work as expected. I can see the bones in the wrong position using the debug renderer. Scaling up the skeleton seems to move the bones closer to expected position but they are never quite in the right position
I have skeleton.updateWorldTransform() after apply() call. Not sure if that helps.
SilverStraw написалI have skeleton.updateWorldTransform() after apply() call. Not sure if that helps.
Nothing changed
Sorry you are having trouble. Please post or email your skeleton data and atlas so we can see the problem firsthand. contact@esotericsoftware.com
Nate написалSorry you are having trouble. Please post or email your skeleton data and atlas so we can see the problem firsthand. contact@esotericsoftware.com
I found the solution, it had nothing to do with skins. Scaling the whole skeleton also seemed to be scaling the bones with a transform constraint with a scaling mix. Setting the constraint to local solved the issue.
Great! Glad you got it worked out.