5 Replies Latest reply on Dec 14, 2017 10:47 AM by ClayUUID

# parent/child rotation speed logic

somebody can explain to me, what's going on here?

i have one mc(inner) inside another(outer).

outer.rotation+=1;

inner.rotation+=1;

result: inner mc moves two times faster, than parent. ok.

outer.rotation+=1;

inner.rotation+=0.5; (half, right?)

result: inner mc still moves!

outer.rotation+=1; (must be degree, if not defined other?)

result: same speed.

what kind of logic stands behind this behavior?

• ###### 1. Re: parent/child rotation speed logic

For me it's correct.

if you want the children to rotate with the same visual orientation along with the parent, just doesn't change their rotation values.

When you rotate a parent Display Object Container object, its children rotation values remain the same. If they were at 0 degree, they will stay at 0 degree.

So, changes you cause to the rotation values of the children, if different in absolute values, will make them get a different visual orientation in relation to the parent.

If the outer rotation changes by 1 and the inner rotation changes by 0.5, at 30 fps, the outer will rotate 30 degrees during 1 second while the inner one will rotate 15.

So they must have a different visual orientation.

• ###### 2. Re: parent/child rotation speed logic

I think the last one works because 1rad doesn't make sense, and so you're adding zero to the rotation of the line, and so it stays in sync with its parent.

To paraphrase JoãoCésar: "just don't change their rotation values.".

• ###### 3. Re: parent/child rotation speed logic

arthurb65311981  wrote

outer.rotation+=1;

inner.rotation+=0.5; (half, right?)

result: inner mc still moves!

Explain why you believe the inner movieclip shouldn't move if you're incrementing its rotation.

And what is "1Rad"? There is no such constant in AS3.

• ###### 4. Re: parent/child rotation speed logic

i based my opinion on rotation speed of parent.

if the child from the left example moves 2 times fast, than parent, i make logical conclusion, and ask for 0.5 rotation at each step.

• ###### 5. Re: parent/child rotation speed logic

The .rotation property is in degrees, not radians. Radians are so much smaller than degrees, that adding 1 radian to the rotation is almost the same as adding nothing.