- Home /
Animation not rendering on canvas set to overlay
Hello, I have a UI canvas and I'm trying to get a simple animation to play when the scene begins. I put some sprites (which are just shapes) as children of the canvas then put the animator on the canvas. I then set the shapes to appear for a few seconds then disappear (like I said... simple!). This works fine when the render mode on the canvas is set to Worldspace but when I try to change it to Screen Space - Overlay or Screen Space - Camera, the animation is not showing up. Any idea why this would only work in Worldspace? Is there any way I can get this to be locked to the camera so the user always sees the shapes no matter which direction they look?
humm, without see your animation, is, quite vage, but maybe you move the sprites while was setting the anim, the transform.position of each sprite change on 3d space, for each space camera, to evade this check and delete all of the transform properties from the animation, leave only who make the sprites dissapear (spriteImage.alpha or gameobject.active maybe?)
Answer by xxmariofer · Jan 13, 2019 at 10:11 AM
Hello @megabyte5 i would suggest not using sprites in the canvas, since canvas should work only with UI elements. Try creating an UI.Image object in the canvas and creating an animation that modifys the Image.image property (Works the same as sprites).
O$$anonymous$$G that worked perfectly! Thank you, @xxmariofer!!