问题
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 :
- Put your object in a specific layer (called
MyLayer
for the sake of the example) - Set the
Culling mask
of a new camera to render only this specific layer - Uncheck the
MyLayer
in theCulling mask
of your main camera in order to prevent the latter to render your model - Set the
Clear flags
toDepth only
of the camera to prevent the latter from rendering the skybox - Create a new Render texture in your project, and drag & drop it in the
Render Texture
field of your new Camera - Add a new Raw Image to your UI canvas and assign the render texture in the
Texture
field - 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