Skip to content

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

void YaCameraAPI.SetCameraOrientation(YaEntity targetPlayer, float3 orientation)Beta
Sets the camera orientation. Cannot be set with the FixedPositionAndLookAt, SideScroll, or TopDown component.
  • targetPlayer The target player
  • orientation 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 player
  • orientation The direction that the player faces
  • cameraOrientationFlags Which axis will be considered in this call.Ignored axis value will use camera's relevant original value.
void YaCameraAPI.SetCameraPosition(YaEntity targetPlayer, float3 position)Beta
Sets the camera position. Cannot be set with the ThirdPerson, SideScroll, or TopDown component.
  • targetPlayer The target player
  • position The position
void YaCameraAPI.SetCameraDistance(YaEntity targetPlayer, number distance)Beta
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 player
  • distance The distance
void YaCameraAPI.SetCameraFollowAt(YaEntity targetPlayer, YaEntity followTarget)Beta
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.
void YaCameraAPI.SetCameraLookAt(YaEntity targetPlayer, YaEntity lookAtTarget)Beta
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.
void YaCameraAPI.SetCameraControllable(YaEntity targetPlayer, boolean controllable)Beta
Determines if the camera view is controllable.
  • targetPlayer The target player
  • controllable 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.
void YaCameraAPI.SetCameraFov(YaEntity targetPlayer, number fov)Beta
Clamps the camera's field of view (FOV) value between 1 and 179.
  • targetPlayer The target player
  • fov The field of view of the camera
void YaCameraAPI.SetCameraSensitivity(YaEntity targetPlayer, number sensitivity)Beta
If the camera view is controllable, use this API to adjust the speed of the camera.
  • targetPlayer The target player
  • sensitivity 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 player
  • nearFarClippingPlane 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.
void YaCameraAPI.SetCameraRestore(YaEntity targetPlayer)Beta
Restores initial camera settings. To restore the initial camera status, call this API together with the SetCameraControllable API.