Unity makes simple animation effects

Requirements: Make a door rotation animation, the effect is as follows: 

Solution:

1. Click Window->Animation->Animation in Unity to bring up the Animation panel, as follows:

2. In order to make the axis of the door on the edge of the door so as to make the effect of the door rotating around the edge of the door, you need to create a new gameObject first, move the axis of the gameObject to the edge of the door, and then put the door model into the gameObject:

Then click the button to adjust to Pivot:

 At this point, the door can already be rotated around the door.

2. Select the model you want to animate in the Hierarchy panel, click "Add Component" at the bottom of the Inspector panel, search for "Animation" and click Add:

3. Create an Animation first, then click "Add Property"->Transform->Rotation in the Animation panel, as shown below:

 4. Click the origin in the upper left corner of the above picture at 0:00 seconds to record the starting point

5. At 0:40 seconds, set the Y value of the Rotation of the doorObject to 90 degrees, and then click the red dot to complete the recording

6. Improvement: You can set the angle of doorObject to 75 degrees at 0:40 and 90 degrees at 1:00 

7. It can also be set on two-dimensional coordinates by clicking the curves button 

Guess you like

Origin blog.csdn.net/ChaoChao66666/article/details/123432296