I’m total newbie at Blender Python (and python itself) so i need your help
Please take a look at my script:
import GameLogic import Blender from Blender import Material cont = GameLogic.getCurrentController() ray = cont.getSensor("CamRay") object = ray.getHitObject() pos = object.getPosition() pos = pos - 0.1 object.setPosition(pos) mesh = object.getMesh() matName = mesh.getMaterialName(0) material = Material.Get(matName) material.setRGBCol([ 1.0, 1.0, 1.0]) #don't work material.rgbCol = [1.0, 1.0, 1.0] # .. either
So it works with my camera ray sensor. When camera looks at the box in “game” box is moved… That works, but there are problem with modifying material, thats for sure. All i want (yet) is to highlight object witch is pointed by camera. How to do that properly?