- Home /
Rotating Child Around World Space
Hello,
I have literally spent all day trying to get this to work. I have a parent cube, with four child object "tires". What I want is for the children to rotate as the cube moves forward, making it appear as a tire would. I know realistically a lot more should go into this to make it look real, but I want to learn the basics first.
Problem I am having is the rotation being done around the parent, which is resulting is my round tires turning very oblong and then rotating. I simply want my tire to rotate assuming it's pivot point was dead center, as if it had no parent.
This works perfect if I detach the object from it's parent, but I will be moving parent a lot and I would prefer to not have to write a script to mimic it being a child.
I would really appreciate any incite on this and it is really driving me insane.
Thanks in advance,
Anthony
Answer by hellcats · Apr 22, 2011 at 04:47 AM
Do you have a non-uniform scale factor of either your parent or tire objects (look at the "Scale" values of the transform). If they are not all the same number, then you will get weird distortions when you rotate something. Remember that the scale factor of the parent affects its children.
Since the body of the car is a cube that is longer width wise then height wise, yes it is. I did not notice yesterday my scale changed when adding to the parent. Now if I have my parent as 1,1,1 the scale ratio on the child stays the same and starts to rotate correctly. I guess the question at this point then is how do I take my body and make it 1x1x1 while still keeping my original aspects. I know the logic of what I'd have to do, just no clue how. Is there a way to take an object and convert it into it's own "$$anonymous$$aterial" thats now 1x1x1? I tried making a prefab but still uses same scale
Actually... I solved my issue when I remembered there are empty options. I simply created an empty object, and made body and tires children of that. Since empty object is 1x1x1, it works perfect! If you can suggest a better way, I always like more experienced peoples advice, but thanks!