I am doing a boundary checking in skybox where the camera cannot move out of skybox. But using this code:
Seems there is a problem in (Position.x <= 195 && Position.x >= -195)) where I still can get out of the skybox. What is the right way of coding such as all of them would not moved out of the skybox. It seemed my codes only the Position.y and Position.z managed to stop the camera from moving out of the skybox. How to compare 3 different position using &&.
if (((Position.z <= 0 && Position.z >= -380) && (Position.y >= 0 && Position.y <= 20)) && (Position.x <= 195 && Position.x >= -195))