WorkSpace

Description

Only objects in the WorkSpace, which will be visually displayed in the 3D scene, can physically interact with each other.

Properties

        string    Name
    The custom name of this object.

        string    ClassName
    The object-type name.

Functions

    DelAllChild()
    Deletes all child 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.

    FindObjOnRay(ray,ignoreInstance)
    Emits a ray, and returns the first part object it touches, the position of the touch point and the normal of the touch surface.

    FindObjOnRayWithIgnoreList(ray,ignoreTable,terrainCellsAreCubes,ignoreWater)
    The variant of FindObjOnRay,ignoring the objects in the input table.

    FindObjOnRayWithWhitelist(ray,whiteTable)
    The variant of FindPartOnRay, only checking the objects in the input table.

    FindPartsInZone(minPoint,maxPoint,ignoreInstance,maxParts)
    Returns an array, the contents of which are all part objects in the specified zone.

    FindPartsInZoneWithIgnoreList(minPoint,maxPoint,ignoreTable,maxParts)
    Returns an array, the contents of which are all part objects in the specified zone, ignoring the objects in the input table.

    FindPartsInZoneWithWhiteList(minPoint,maxPoint,whiteTable,maxParts)
    Returns an array, the contents of which are all part objects in the specified zone, only checking the objects in the input table.

    IsZoneEmpty(minPoint,maxPoint, ignoreInstance)
    Returns a Bool, indicating whether there are part objects of the specified data type or in the specified zone.

    IsZoneEmptyWithIgnoreList(minPoint,maxPoint, ignoreTable)
    Returns a Bool, indicating whether there are part objects of the specified data type or in the specified zone, ignoring the objects in the input table.

    RaycastHit(origin,direction,maxDistance)
    Creates a ray with the specified start point and direction, and returns the objects it hits, the object names, the hit points and the distances.

    RaycastBool(origin,direction,maxDistance)
    Creates a ray with the specified start point and direction, and returns a Bool value, indicating whether the ray hits an object.

    GetGravity()
    Retrieves the gravity of the current game world.

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.