- Home /
How to get an image to layer another image without white background?
Hi I'm completely new to unity and I'm trying to make an small project where an image overlaps another image with the image I displayed I want the ant to be able to make the ant move around the background image. How would I go about that and what would be best gameobject to use to create the ant image?
Answer by Jessy · Jan 26, 2011 at 03:07 PM
Use a shader that supports transparency. It doesn't look like you need lighting. Here is one, but if you don't need tinting, use a simpler version:
Shader "Unlit Alpha Blend" {
Properties { _MainTex ("Texture (A = Opacity)", 2D) = "" }
SubShader { Tags {Queue = Transparent} ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Pass {SetTexture[_MainTex]} }
}
Also, it's going to look bad. Here's how to make it look right: http://answers.unity3d.com/questions/2827/messy-alpha-problem-white-around-edges
Thank you for your help, I created a new shader and copy and pasted that into the NewShader. Is there something I need to do to link the shader to the ant image?