volume
volume
gets/sets the volume the sound is played at.
Type: float
Range: 0.0 and 1.0
Sample
Code
################## Get volume
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator attached to the controller named slam
act = controller.actuators["slam"]
# get the volume
vol = act.volume
################## Set volume
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator attached to the controller named slam
act = controller.actuators["slam"]
# set the volume
act.volume = 0.5
|