• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

parent/child rotation speed logic

Explorer ,
Dec 05, 2017 Dec 05, 2017

Copy link to clipboard

Copied

logic.gif

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?)

inner.rotation+=1rad;

result: same speed.

what kind of logic stands behind this behavior?

Views

390

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 05, 2017 Dec 05, 2017

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 rotati

...

Votes

Translate

Translate
Community Expert ,
Dec 05, 2017 Dec 05, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2017 Dec 05, 2017

Copy link to clipboard

Copied

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.".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2017 Dec 05, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

sorry, my bad. 1rad here is 0,0174533. this equals to 1 degree in radians.

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines