How to constrain camera inside a box

I like to put the camera in a transparent box so that it does not go outside the constrained area, how to set up the box in node?

The easiest way is probably to parent your camera to a physics-object, turn the gravity off, invert the constraining cubes normals and move the physics object instead of the camera, so it collides with the box and doesn’t get out.

This is a setup in which the object can’t go further than -10/10 on the y axis. Try to extend it for a cube!

1 Like

Thank you very much!

camera-constrain.blend (609.4 KB)

Here is the blend file, what did I missed? Are there additional settings in a physics scene?

You .blend confuses me, do you go for the physics or the node way? If you want to use physics, you need to enable Rigidbody for the objects and you don’t need the nodes, if you go the node way the z and y axis are still missing, and the translating nodes have currently no vectors in them, so they won’t do anything. I suggest you to take a look at the little but helpful manual there is for the logic nodes http://armory3d.org/manual/getting_started/tutorial5.html

Now all my Armory file fail to build after trying the constrain, so tired of such unknown thing.

Downloaded the new version, though the preview worked but the previous logic not don’t behave the same, gone through the tutorial but still, node is node, I don’t find any logic in it and I am not making game, just camera rotate and zoom. Those are the fundamental things I get from other plugins.