O'Reilly logo

Unity UI Cookbook by Francesco Sapio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making a floating UI element

In this recipe, you will learn how to make a floating UI element. This is a nice effect to use within every kind of user interface. If you are going to use a very slow movement with a small amplitude, you can use this effect even on menus to give them more life and a professional look. A floating element can add yet another type of dynamic element to the UI, ultimately breaking the usually rigid nature that UI elements tend to have.

How to do it...

  1. First of all, we need to create an UI element. In this example, we will create a panel that can be the background of a menu. To do this, right-click on the Hierarchy panel and then navigate to UI | Panel. Finally, rename it Floating Panel. Of course, it is possible to resize ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required