HUD Icon TurnTable


You need a copy of a clicked object in your game to show up in a heads-up-display and slowly rotate around.

  1. Add an empty GameObject to your heads-up-display to act as the target for the constraint. Scale this down to the size you want (keep the scale uniform - the same in all 3 axis)
  2. Use Unity's Instantiate() to get a clone of the instance you want to be the icon
  3. Attach a Transform Constraint component set to only Position and Scale
  4. Attach a TurnTable Constraint and set the speed.
As an alternative to #3, you could make the clone a child of the HUD GameObject, instead of constraining it, and reset it's local position, rotation and scale to, Quaternion.Identity, and respectively.

As an alternative to #4, you could add the Turntable Constraint to the GameObject in the HUD directly at edit-time (With this alternate setup, in #3 you will have to activate rotation as well, or use the alternative above). Then in the script where you create the clone, simply enable the turntable component, then disable it when the "icon" is destroyed. However, putting the script on the clone is probably easier because you don't need to worry about turning it off, it will be destroyed.