I’m trying to get it so that the camera either detects the wall or is clamped to 180 degrees movement.
I’ve tried to create a new orbitCamera script to test, but any other script I make for the camera doesn’t receive any input even though it compiles without error.
So I’m currently using the basic Orbit Camera script.
I think you can do it by setting a trigger to the camera entity, and catch the triggerenter/triggerleave events.
Though if you are only looking on how to restrict the camera movement and your objects are fixed in their positions you could get away with setting a min/max yaw.
OrbitCamera.prototype._clampYawAngle = function (yaw) {
return pc.math.clamp(yaw, -this.yawAngleMax, -this.yawAngleMin);
};