I have a scene with a sphere and when the player presses space I want to make the player half visible…like a ghost…
I checked docs and can’t find a way to set alpha of objects…
How can I do this?
I have a scene with a sphere and when the player presses space I want to make the player half visible…like a ghost…
I checked docs and can’t find a way to set alpha of objects…
How can I do this?
you cannot set the alpha of the objects, instead you can set the alpha to the material that is being applied to the object, provided the shader on the material supports alpha. Transparent diffuse is one sample shader you can look into. you can access the material of the object like this
or
this is depending on the shader you are using. from here you can create a color variable and set your values and assign it to any of the above function/variable…
also do take a look at this wiki script which would make it much easier for you