For the spinning animation, we want the Health_Pickup prefab to make a complete 360-degree rotation on its z axis every second, which can be done by setting three keyframes and letting Unity take care of the rest:
- Select Add Property | Transform and click on the + sign next to Rotation:
- Click on the Record button to start the animation.
- Place your cursor at 0:00 on the timeline but leave the Health_Pickup prefab's z rotation at 0:
a. Place your cursor at 0:30 on the timeline, and set the ZÂ rotation to 180.
b. Place your cursor at 1:00 on the timeline, and set the ZÂ rotation to 360:
- Click on the Record button to finish the animation.
- Click on the Play button to the right of the record button to see the animation loop.
The Health_Pickup object now rotates on the z-axis between 0, 180, and 360 degrees every second, creating the looping spin animation. If you play the game now, the animation will...