
- get/set the sharpness of the specular reflection
- integer
- 1 to 511
- Properties menu >> Material >> Specular >> Hardness

################## get the sharpness of the specular reflection
# import bge
import bge
# get the current controller
controller = bge.logic.getCurrentController()
# get object that owns this controller
obj = controller.owner
# There's only one mesh on my model
mesh = obj.meshes[0]
# And only one material on the mesh
mat = mesh.materials[0]
# get specular reflection sharpness
spec_sharp = mat.hardness
################## set sharpness of specular reflection
# import bge
import bge
# get the current controller
controller = bge.logic.getCurrentController()
# get object that owns this controller
obj = controller.owner
# There's only one mesh on my model
mesh = obj.meshes[0]
# And only one material on the mesh
mat = mesh.materials[0]
# set sharpness of specular reflection
mat.hardness = 50