Camera

Description

Used to shoot scenes or specified objects, offering multiple modes and adjustable parameters.

Camera functions:
1. Camera has four modes: follow, follow shot, watch, custom.
2. In the edit mode, some of the camera parameters take effect. In the operate mode, the camera parameters depend on the operation mode selected in StarterPlayers.
3. The offset of the camera is that of the shooting point.
4. When the camera collision is enabled, the camera will be pushed to the forefront of the colliding object. Otherwise, the barrier will become transparent.

Properties

        string    Name
    The custom name of this object.

        string    ClassName
    The object-type name.

        RWObject    Parent
    The parent of this object.

        Enum.CameraType    CameraType
    The camera's shooting modes: follow, fix, watch, follow shot and custom.

        int    Subject
    The current object that the camera is shooting.

        float    FieldOfView
    Determines the visual field of the camera.

        float    Distance
    The distance between the camera and the focused target.

        float    Pitch
    The vertical angle of the camera.

        float    Yaw
    The horizontal angle of the camera.

        Vector3    Offset
    The offset of the camera's shooting point.

        bool    Occlusion
    Once enabled, the camera will be pushed to the front of the barrier.

        float    Transparency
    The transparency of the obstacle between the camera and the focused target.

        float    MinZoomDistance
    The minimum distance between the camera and the focused target.

        float    MaxZoomDistance
    The maximum distance between the camera and the focused target.

        float    MinPitchDistance
    The lower limit of a camera at the vertical angle, ranging from -90°to 0°.

        float    MaxPitchDistance
    The upper limit of a camera at the vertical angle, ranging from 0° to 90°.

Functions

    RWObject.Create(classname)
    A special function, creating an instance of the specified class.

    DelAllChild()
    Deletes all child objects.

    Clone()
    Clones an object to create a copy.

    Destroy()
    Delete objects.

    GetAncestorByName(Name)
    Returns the object's first parent node with the same name.

    GetAncestorByClassName(className)
    Returns the object's first parent node of the same class.

    GetChildByName(Name,recursive)
    Returns the object's first child object with the same name. If the second parameter is true, it will search through descendants of all hierarchies.

    GetChildByClassName(className,recursive)
    Returns the object's first child object of the same type. If the second parameter is true, it will search through descendants of all hierarchies.

    GetAllChild()
    Seeks all its child objects and returns as a list.

    GetAllDescendant()
    Recursively seeks all its descendants and returns as a list.

    IsClass(ClassName)
    Judges whether it is the class the same as the given object class or not.

    IsAncestor(TarObj)
    Judges whether itself is the ancestor of the target object or not.

    IsDescendant(TarObj)
    Judges whether itself is the descendant of the target object or not.

    WaitForChild(childName,timeout)
    Seeks its own child object.

    Child(childName)
    Seeks its own child object by a given name.

    Equals(TarObj)
    Judges whether the target object is the same as itself or not.

    GetLargestDistance()
    When there is a barrier between the camera and the focused target, move the camera to avoid the barrier. This function returns the distance that the camera needs to be moved.

    GetAllObscuringParts()
    Retrieves all barriers between the camera and the focused target, and returns the barrier objects as a list.

    ScreenToRay(pos)
    Emits a ray from the specified coordinates of the screen in the direction the same as that of the camera.

    ViewportToRay(pos)
    Emits a ray from the specified coordinates of the camera Viewport in the direction the same as that of the camera.

    WorldToScreen(pos)
    Converts the specified coordinates in the game world to the coordinates in the screen.

    WorldToViewport(pos)
    Converts the specified coordinates in the game world to the coordinates in the camera Viewport.

Events

    ChildAdded(childobject)
    Triggered when a child object is added.

    ChildRemoved(childobject)
    Deletes all child objects.

    DescendantAdded(descendantobject)
    Triggered when a descendant is added.

    DescendantRemoved(descendantobject)
    Triggered when a descendant is removed.

    AncestryChanged(AncestryChanged)
    Triggered when the ancestry is changed.