Redraw() Function dont does redraw the material in game

hi i have a little problem i have changed the material color from a plane with 2 scripts red and green at this scripts i have 2 keys r and g if iam in the game mode and press the key the color dont does change of course i have redraw() at the end of the script but the color does just change if i have left the game mode then

here the little script

import Blender
mat = Blender.Material.Get(“Material.003”)
mat.R = 0.0
mat.G = 1.0
mat.B = 0.0

so why dont does redraw() update the color in game mode?

thx Crown

Because it simply doesn’t work in game mode. There are no real materials as in Blender.
There are possibilities:

  1. Use object colour IPO - sets colour for whole object - use IPO actuator
  2. Change mesh to mesh with different colour - use Edit Object actuator
  3. Change vertex colours using Python script
  1. Change mesh to mesh with different colour - use Edit Object actuator

i have tried this but the script dont works

heres the script

scene = GamLogic.getCurrentScene()
objects = scene.getObjectList()
for o in objects:
if == ‘DOOR_01’:
DOOR_01 = o

contr = GameLogic.getCurrentController()
act = contr.getActuator(‘angerwechsel’)

if DOOR_01.tur_auf == 11:

i know here i want to change the plane how would be the script to change just the color ? thx for help crown

You don’t have to use Python to accomplish this task - just set up logic bricks properly: property sensor from object DOOR_01 connect to controller and actuator of object, where you want to change a mesh.

Anyway, in your script is a mistake in the first line: “GamLogic” and object names has prefix “OB”, so it won’t be found in loop.

sorry for teh gam. mistake and many thx for the OB prefix the script does now working fine and i dont need to change the texture i just change the whole plane

thank you man