This would require python. You can set up the Logic Bricks by connecting all the sensors (+ an Always sensor) to a python controller (set to module mode), an all the actuators to that python controller. Make sure you name them correctly.
Starting code:
from bge import logic
def main(cont):
own = cont.owner
You can get sensors with:
sensorName = cont.sensors["NameHere"] #put the sensor's name between the quotes, but leave the quotes
And actuators with:
actuatorName = cont.actuators["NameHere"]
Next, you can check whether the sensor is triggered or not with:
if sensorName.positive:
#stuff will go here, mind the indentation
And activate actuators like this:
cont.activate(actuatorName)
The object’s color, and this is the object color, not material, is defined with:
own.color
And it is a list of 4 things, RGBA.
So you can check if an object is red like this:
if own.color == [1.0, 0.0, 0.0, 1.0]:
#do something
Combined, you could have something like this:
#script.py
from bge import logic
def main(cont):
own = cont.owner
near = cont.sensors["Near"]
move = cont.actuators["Move"]
turn= cont.actuators["Turn"]
if near.positive:
if own.color == [1.0, 0.0, 0.0, 1.0]: #if object is red
cont.activate(move) #move the object (actuator)
elif own.color == [0.0, 1.0, 0.0, 1.0]: #if object is green
cont.activate(turn)
In the module controller, put “script.main” (without quotes)
Hopefully this helps :yes: