The Follow Camera
CreatiCode last edited by info-creaticode
- Using an Orbit Camera for 3D Scene Navigation
- 3D Coordinates and Positions
- 3D Directions and Rotations
When we are using an obit camera, if a car or an avatar is moving around, it can easily run out of our camera view. In such cases, we need to use a “follow camera” (also called a "tracking camera’), which follows the target object as it moves.
Usually, you should use this block immediately after the block that adds the target object to the scene, such as “add avatar”, “add model” or “add box”, etc.
The “Add Follow Camera” Block
This is the distance between the camera and the target object’s position.
This input raises the camera’s target point. As shown above, when the target is an avatar, our camera would be looking at the feet of the avatar by default. If we want to put the avatar body at the center of our camera’s view, we can use the “z offset” to make the camera look at a higher point.
V-Angle and H-Angle
These 2 inputs are the vertical and horizontal view angles of the camera, similar to orbit cameras.
The direction lock is the most important input for the follow camera. It controls how the camera moves relative to the target.
- Direction Lock = Fixed: This means that the camera’s view angles and distances will remain fixed, no matter which way the target object is facing or moving to. When H-Angle is 0, the camera will look forward in the direction of the Y-Axis. When H-Angle is 180, the camera will face the opposite direction. Also, you can not use the mouse to rotate or zoom the camera.
- Direction Lock = Target: This means that the camera will always point in the same direction as the target object. For example, if the target object turns right, then the camera would rotate as well to stay behind the target. The H-Angle input will be ignored in this case, and you can not control the camera using the mouse.
- Direction Lock = Free: This mode simply means you can control the camera at any time, even when the target is moving. Note that you can rotate the camera with the left mouse button, you can not shift the target with the right button anymore, because the target point is locked on the target object this camera is following.
- Direction Lock = Free (Right Button): This mode is the same as the “Free” mode, except that you need to use the right mouse button to rotate the camera.
When the target is blocked by another object, we can make that object transparent. This input controls the transparency of the blocking object. For example, 0% means the blocking object will fully block the view, and 100% means the blocking object will be fully transparent.