YaCameraAPI¶
Beta
YaCameraAPI
adjusts the player's camera. Before you apply this API, make sure you attach any of the following community components to objects in the scene.- Setting_CameraFixPositionAndOrientation
- Setting_CameraFixPositionAndViewControllable
- Setting_CameraFixPositionAndLookAt
- Setting_CameraTopdown. With this component, the SetCameraPosition and SetCameraOrientation functions are unavailable.
- Setting_CameraRTS
- Setting_CameraSideScroll. With this component, the SetCameraPosition and SetCameraOrientation functions are unavailable.
- Setting_CameraThirdPerson. With this component, the SetCameraPosition function is unavailable.
Functions¶
Sets the camera orientation. Cannot be set with the FixedPositionAndLookAt, SideScroll, or TopDown component.
targetPlayer
The target playerorientation
The direction that the player faces
void YaCameraAPI.SetCameraOrientation(YaEntity targetPlayer, float3 orientation, YaCameraOrientationFlags cameraOrientationFlags)Beta
Sets the camera orientation. Cannot be set with the FixedPositionAndLookAt, SideScroll, or TopDown component.
targetPlayer
The target playerorientation
The direction that the player facescameraOrientationFlags
Which axis will be considered in this call.Ignored axis value will use camera's relevant original value.
Sets the camera position. Cannot be set with the ThirdPerson, SideScroll, or TopDown component.
targetPlayer
The target playerposition
The position
Sets the amount of extra distance between camera and target. Cannot be set with the FixPositionAndOrientation, FixPositionAndLookAt, FixPositionAndViewControllable component.If distance value is outmatch ygc setting's distanceInterval value,the distance value will be clamped by setting.
targetPlayer
The target playerdistance
The distance
Sets the target for the camera to follow.
You can call this API or the SetCameraLookAt API to set the target when using the ThirdPerson, FixPositionAndViewControllable, RTS, SideScroll, or TopDown component.
Sets the target for the camera to look at.
You can call this API or the SetCameraFollowAt API to set the target when using the ThirdPerson, FixPositionAndViewControllable, RTS, SideScroll, or TopDown component.
Determines if the camera view is controllable.
targetPlayer
The target playercontrollable
If true, the camera view is controllable; if false, the camera view is uncontrollable. It can be set with the Third Person, FixPositionAndViewControllable, or RTS component.
Clamps the camera's field of view (FOV) value between 1 and 179.
targetPlayer
The target playerfov
The field of view of the camera
If the camera view is controllable, use this API to adjust the speed of the camera.
targetPlayer
The target playersensitivity
The speed of the camera movement
void YaCameraAPI.SetCameraNearFarClippingPlane(YaEntity targetPlayer, float2 nearFarClippingPlane)Beta
Adjusts the near and far plane of the camera's viewing frustum.
targetPlayer
The target playernearFarClippingPlane
The near and far clipping plane of the camera's viewing frustum. Recommended near clipping plane value: 0.2. The far clipping plane should not be too close to the camera as any objects further away from the camera than the far clipping plane isn't displayed.
Restores initial camera settings.
To restore the initial camera status, call this API together with the SetCameraControllable API.