Unity object Rotation, rotation

Source: Internet
Author: User

1. The object's specific rotation around which axis, corresponding setting value;

Transform.  Rotate (new Vector3 (1,0,0)); //rotation around x-axis//By default, the object rotates around the XYZ axis of world coordinates, that is, the object rotates around the y-axis of the world center 0,0,0. The statement is equivalent to transform. Rotate (new Vector3 (1,0,0), space.world); If you need to rotate, change this parameter, chestnut transform. Rotate (new Vector3 (1,0,0). space.self);

2. Set the center of rotation around which to rotate.

Transform. Rotatearound (Sth.transform.position,vector3.up,rotatespeed);

Expansion: Unity switching scenario does not destroy objects: Dontdestroyonload (Gameobject);

Unity object Rotation, rotation

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.