How to play 3D animation on a 2D canvas in Unity

痞子三分冷 提交于 2020-01-21 09:11:07

问题


I like to play animation on a Canvas.

I made a canvas as shown in the following image.

I like to play a golfer animation on the green color canvas. Is it possible?

I have animation model as shown in the second figure.

I like to play that golfer animation on the canvas. How can I do that? I drag and put under canvas as child object, it doesn't work.


回答1:


As I explained in my comment, I would do as follow :

  1. Put your object in a specific layer (called MyLayer for the sake of the example)
  2. Set the Culling mask of a new camera to render only this specific layer
  3. Uncheck the MyLayer in the Culling mask of your main camera in order to prevent the latter to render your model
  4. Set the Clear flags to Depth only of the camera to prevent the latter from rendering the skybox
  5. Create a new Render texture in your project, and drag & drop it in the Render Texture field of your new Camera
  6. Add a new Raw Image to your UI canvas and assign the render texture in the Texture field
  7. Run your 3D animation

Your camera will render the animation into the image on your UI



来源:https://stackoverflow.com/questions/46889822/how-to-play-3d-animation-on-a-2d-canvas-in-unity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!