0
$\begingroup$

I want my scene to "fade in" from black when it starts up in the BGE. For that reason I have created a plane (with shadeless, diffuse black material) in front of the camera that I want to make transparent by decreasing the alpha value.

(I connected a Python script to an Always sensor so I have a function that is called every frame; from there I set the alpha.)

However, setting the alpha does not have any effect.

plane = bge.logic.getCurrentScene().objects["blackScreen"]
plane.meshes[0].materials[0].alpha = 0.0 # just an example

The plane will always be rendered in the color (including alpha!) that was set in Blender.

Why does it not work?

$\endgroup$
0
$\begingroup$

you don't need Python to do that. You can animate the transparency and just play the animation. You can download the example blend belowor rebuild the setup from the screenshot below. In my case there is a fade in of 100 frames and a little bonus - the plane is destroyed when the fading is done.

enter image description here.

Enjoy!

$\endgroup$
  • $\begingroup$ I was able to solve it by changing the Shading setting from "Multitexture" to "GLSL", too. But your solution is superior. $\endgroup$ – JackD Aug 11 '17 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.