Help with collision and logic gates

I started making some basic game using logic bricks and I wanted to move a camera around when pressing arrows (I managed this) but stop when collide with a plane which would serve as a border. I simply didn’t want to move the camera too far. And there I got stuck. I tried to do something like inverting the collision sensor output and using the and logic gate together with the arrow keyboard sensor, but nothing happened.

Could somebody help me?


Thank you,

the camera do not have collision , parent it to a cube and move the cube that should work
if you do not want to see the cube simply turn off visibility in the physics tab.

May be a Constraint Actuator ?
It can works with defined Max location on the 3 axes, or set a distance to an object.

Used it for a camera where the location limits have to be a box.

You can also parent an empty to the camera and shoot rays (Invert) looking for a property on your borders. So just replace the collision sensor with a ray and set it to invert.