I’m trying to build a basic first person player template, and I want to be able to limit the rotation of the camera around the X axis between two values (e.g. 0 to 180 degrees). However I can’t seem to get the Rotation Constraint actuator to work. Here’s the code I’ve got for the actuator (‘actuCamRollConstraint’):
actuCamRollConstraint.limit = bge.logic.KX_CONSTRAINTACT_ROTX
actuCamRollConstraint.direction = [0, 0, 1]
actuCamRollConstraint.max = 180
actuCamRollConstraint.min = 0
cont.activate(actuCamRollConstraint) #this is called after I activate the motion actuator controlling the camera rotation
I’ve tried playing with the values on the actuator panel itself as well, but nothing seems to work. Any help is much appreciated.