Skip to content

YaCameraAPI

Beta
YaCameraAPI adjusts a 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 player entity that owns the camera
  • orientation The direction that the camera faces
void YaCameraAPI.SetCameraPosition(YaEntity targetPlayer, float3 position)Beta
Sets the camera's position. Cannot be set with the ThirdPerson, SideScroll, or TopDown component
  • targetPlayer The player entity that owns the camera
  • position The camera's position
void YaCameraAPI.SetCameraFollowAt(YaEntity targetPlayer, YaEntity followTarget)Beta
Sets the target for the camera to follow.
  • targetPlayer The player entity that owns the camera
  • followTarget The camera target to follow
void YaCameraAPI.SetCameraLookAt(YaEntity targetPlayer, YaEntity lookAtTarget)Beta
Sets the target for the camera to look at.
  • targetPlayer The player entity that owns the camera
  • lookAtTarget The camera target to look at
void YaCameraAPI.SetCameraControllable(YaEntity targetPlayer, boolean controllable)Beta
Determines if the camera view is controllable
  • targetPlayer The player entity that owns the camera
  • 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 player entity that owns the camera
  • 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 player entity that owns the camera
  • 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 player entity that owns the camera
  • 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.