- Home /
iTween - rotation messed up on children objects
Hi I'm trying to animate my actor with tweens and have a following problem: Actor consists of 'body' which is a parent to legs and arms objects. I have a tween on legs that rotates them back and forth on z axis to simulate walking and it runs fine till I try to rotate the actor in opposite direction (it's a 2d-view-from-a-side game) I apply 180 y axis rotation tween to 'body' object and all goes well except for the legs. They end up in weird half rotation (on y axis). Manual attempts to set their rotation to match the body fails as tween seem to continusly trying to align them to the mentioned 'half rotation'. So why tween on y axis affects the other on z axis? Any ideas how to fix it? I guess I could try stopping the leg tween before applying body rotation but that code gonna look ugly since tweens take some time to stop.
I have a feeling that this has something to do with iTween being a static library. I can't test anything out at the moment, but this might simply be a limitation in that aspect (Just speculation). Is there a good reason why you are using iTween ins$$anonymous$$d of the built in animation manager? By using the animation system, you will get much better control over things like crossfading, blending, and animation layers.
Answer by shadowriffe · May 31, 2012 at 09:44 PM
You don't need to use a third-party animation tool, Unity has one inbuilt that can just record movements and such in the editor and play them back. It is what I used on my placeholder simple-shape characters before I actually modeled and imported. Here are a couple links to get you started:
http://unity3d.com/support/resources/tutorials/video-animation-view
http://unity3d.com/support/documentation/Manual/Animation.html
http://unity3d.com/support/documentation/Manual/Character-Animation.html
Answer by laggyluk · May 31, 2012 at 09:25 PM
To use that kind of animations i would have to prepare them first in a 3d software, right? I'm using 2dtoolkit for sprites handling and it's a retro looking game so I figured out that animating them form code makes sense. Faster parameter tweaking in game enviroment without need to export etc.
Just as a heads up, don't make another answer when you mean to make a comment.
Answer by laggyluk · Jun 01, 2012 at 08:39 AM
Nice, somehow I've missed that feature :D will check it out
Glad to help. Again, don't use the answer text field to reply to an answer or another comment. Add new comment to the question or to an existing answer. Also, please mark an answer as correct if it solved your problem. Thanks.
Answer by laggyluk · Jun 01, 2012 at 09:21 PM
Maybe that's not the answer to my question but thanks for the tip, it's all I needed!
Your answer
Follow this Question
Related Questions
iTween Rotation Not Precise 0 Answers
Flip over an object (smooth transition) 3 Answers
Child-objects are not properly 'transformed' with parent 1 Answer
I-tween rotate around object 1 Answer
iTween - Rotation Add get's uneven after several rotations 2 Answers