Rotation cap ?

http://www.pasteall.org/blend/40534

You will need joypad, i set the variables in python to Ps4 pad, it also works with xbox 360.
Can somebody cap it on the Up/Down, so it has like 90 up -90 down ?
This would be great, as i can then use controllers in my game.

This might help others out as well, the .blend i changed a little, but found on the forum somewhere.

BLENDER 4 LIFE

Any help would be appreciated :slight_smile:

If x<=.99 and condition.positive:
x+=.01

Basically you can do 95% of this with logic,

You manipulate a number to stay inside a range,
Then with python, you use the property to offset a euler rotation vector

Like

Rot = own.parent.worldOrientation.to_euler()

Rot.z +=own[‘x’]

own.worldOrientation=Rot

Thinking of how your actors are normally setup,
You can do the mouselook 2 ways,

1.Spine animation, use property actuator

2.Copy rotation in spine and weapon parented to bone
however it makes effect difficult because copy rotation happens after python.(like laser sight using hitPoint)

So my own solution was to use a callback to place my actors currently held prop.