0
\$\begingroup\$

Good day. I would like to create a "rich" GUI for my game.

How can i add a 3d model to a GUI Button (with continous rotation ) ? If I can't add a 3d model to a GUI button, what is the best way to visualize a 3d model rotating ?

Maybe creating a video file or animated gif and adding it to my button ?

Thanks

\$\endgroup\$
2
\$\begingroup\$

I suppose you're talking about the new UI system (coming with UnityEngine.UI) and not the old GUI system.

If you want to display a 3D model in a GUIButton, you can simply use a Render Texture. In another part of the scene you display the animated 3D model you want to use and put a camera dedicated to watch it. The main difference between this new camera and the main camera is that the new one doesn't render on screen but in a Render Texture. Then you can easily use this Render Texture like a regular texture in your UI using RawImage component.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.