Unity rotates the scene as a whole while keeping the scene root node transform and the hierarchy structure intact

Source: Internet
Author: User

For example, we assume the following structure:

Its hierarchy are as follows:

The transform of the root node road is the following clean original state:

Now you want to keep the road hierarchy and transform in the same situation and rotate the road 90 degrees.

This means that you want to put the rotation of the road down to the child nodes, of course, so that each child node will not only need to rotate also need to translate.

One way to compare trickery is as follows:

1, add the child node temp under road (its transform is the original unit state), drag Cube (9) ~cube (12) to temp,

2, rotate temp 90 degrees.

3, drag the Cube (9) ~cube (12) from the temp and put it back under the road,

4, Delete temp. Get.

Note: The reason to keep the hierarchy constant is to prevent the script from invalidating because the script s may be hung on the road, and the script s may contain findchild statements, and if hierarchy changes, it is likely that Findchild will not find the corresponding child nodes.

Unity rotates the scene as a whole while keeping the scene root node transform and the hierarchy structure intact

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.