Limit rotation

So i have a question about limiting the amount of degrees an object can rotate in the blender game engine. I have an object that when neutral is at 0 degrees, id like it to be able to rotate with a min of -90 degrees and a max of 90. Ive got it set at the moment with logic bricks like so

Keyboard - Q --------------------AND-------------------Motion - Rotate -1

Keyboard - E --------------------AND-------------------Motion - Rotate +1

so when you press the keys the object rotates, however i dont want it to go past a certain point, so i set a constraint in the properties panel, to limit the amount it could rotate on the z axis, and works in blender itself when i rotate it, however, constraints dont seem to have any effect in the game engine. So, my question is. any ideas on how to do this?
I tried animations but couldnt get it to work.

EDIT: Solved
Using this method


A possible setup for the upper limit (a similar one for the -90° limit applies):


If keypress 1------------------and--------motion rot 1 degree
Property “rot” min:0 max:89----/ ---------property rot add 1

If keypress 2------------------and-----------motion rot -1
Property rot min:1 max:90-----/ ------------property rod add “-1”

Tried this, only issue is when it gets to 89, it adds one more because its still technically in the interval, so its gets stuck at 90, then it cant rotate back because its not in the actual interval. tried playing around with multiple properties but im really stuck.

When i try this my object doesn’t even rotate :confused:

Found a solution. My current set up.


…and that’s what I intended when I wrote “a similar solution for the -90° limit applies”

Yeah, its basically the same setup, just integer prop instead of float. and i had my property mixed up when i tried it the first time