Player
Beta
Beta
Calculates the camera position as if camera posture is not operated with setPosition()
and setRotation()
.
It calculates the camera position when the camera's global rotation is rotation
.
In VR environment, it ignores rotation
and isFirstPersonView
values, returning the same value as getPosition()
.
In non-VR environment, it calculates the camera position based on the view state specified in the argument.
In non-VR environment, the result of this method may be null
when the view has switched to a special mode.
For instance, when the player starts editing accessories, it will return null
.
The global rotation of the camera, ignoring the roll angle.
true
for first person view, false
for third person view.
Beta
Obtains the current position of the camera in global coordinates. In VR environment, the result indicates the player's eye position. In non-VR environment, the result indicates the camera position based on the current perspective.
Especially in non-VR environment, the result may be null
when the camera is in a specific mode.
For instance, when the player starts editing accessories, the result will be null
.
Beta
Obtains the current rotation of the camera in global coordinates. In VR environment, the result indicates the player's eye position. In non-VR environment, the result indicates the camera rotation based on the current perspective.
Especially in non-VR environment, the result may be null
when the camera is in a specific mode.
For instance, when the player starts editing accessories, the result will be null
.
Beta
Gets whether the player is using first person view.
This methods always returns true
for the player in VR.
When the player is not in VR environment, returns true
if the player is using first person view and returns false
otherwise.
This methods will returns a valid value even if camera is in specific modes.
You can validate the current camera by calling CameraHandle.getPosition or CameraHandle.getRotation and check the result is not null
.
Whether the player is using first person view.
Beta
Sets the default value of the field of view for players who are not in VR environment. The field of view is specified as the vertical angle from the bottom to the top of the screen.
This method has no effect in VR. After changing the field of view by this method, the player can still zoom in and out, and switch between first and third person perspectives using zoom.
The value specified in this method will be reset when calling the method with value
is null
, or when the validity period of the Player Script expires.
The default value of the field of view in degrees, between 10 and 80. The outsided value will be clamped.
If true
, the value is applied immediately without interpolation. This parameter is optional, and if omitted, it is treated as false
.
Beta
Specifies the camera position in global coordinates.
The behavior when this method is called is as follows
The values specified by this method will reset when called with null
for position
or when the Player Script ends.
After reset, the switching operation between first person and third person views will be enabled again.
Additionally, if the view was in first person before calling this method, it will return to first person after the reset.
The global coordinates of the camera.
Beta
Specifies the camera rotation in global coordinates.
The behavior when this method is called is as follows
When this method is called with null
for rotation
or when the Player Script ends, the player will be able to manipulate the camera rotation again.
At this point, the camera rotation will be reset to what it was last specified in setRotation()
, excluding the roll angle.
The global rotation of the camera.
Beta
In third-person view, sets whether to fix the avatar's orientation so that it faces forward. This method can be used for the case that the avatar should aim to objects in the world in third-person view.
This function can also be executed when the player is in a VR environment or first-person view, but it does not affect behavior in a VR environment or first-person view.
The value specified in this method will be reset when calling the method with value
is null
, or when the validity period of the Player Script expires.
Whether to fix the avatar's orientation to face forward
Beta
In third-person view, specifies the position on the screen near the avatar's head in screen coordinates.
The left edge of the screen corresponds to x=0
, and the right edge corresponds to x=1
.
The bottom edge of the screen corresponds to y=0
, and the top edge corresponds to y=1
.
This function can be executed when the player is in a VR environment or in first-person view, but it does not affect behavior in a VR environment or in first-person view.
The value specified in this method will be reset when calling the method with pos
is null
, or when the validity period of the Player Script expires.
The position on the screen near the avatar's head. Both x and y components are rounded to the range 0 to 1.
If true
, the interpolation is skipped and the value is applied immediately. This value is optional and is treated as false
if omitted.
Beta
Specifies the maximum distance between the avatar and the camera in third-person view in meters.
The actual distance between the camera and the avatar may not be equal to the specified value. If there are walls or ceilings around the avatar, the camera will be closer than the specified distance.
This function can be executed even when the player is in a VR environment or in first-person view, but it does not affect the behavior in a VR environment or in first-person view.
The value specified in this method will be reset when calling the method with distance
is null
, or when the validity period of the Player Script expires.
The maximum distance between the avatar and the camera. The minimum value is 0.2, and smaller value will be treated same as 0.2.
If true
, the interpolation is skipped and the value is applied immediately. This value is optional and is treated as false
if omitted.
Generated using TypeDoc
The handle to control the player's camera movement. You can access the handle with PlayerScript.cameraHandle.