Preparing search index...

    Class LookAtComponent

    Orients a SceneObject towards a target SceneObject.

    // Switches through LookAt targets in a list on each tap
    //@input Component.LookAtComponent lookAt
    //@input SceneObject[] targets

    var targetIndex = 0;

    script.createEvent("TapEvent").bind(function(eventData)
    {
    if(script.targets.length > 0)
    {
    targetIndex = (targetIndex + 1) % script.targets.length;
    script.lookAt.target = script.targets[targetIndex];
    }
    });
    // Set aimVectors to [-Z Aim, Y Up]
    // (Useful for aiming the camera since it faces towards -Z)
    //@input Component.LookAtComponent lookAt
    script.lookAt.aimVectors = LookAtComponent.AimVectors.NegativeZAimYUp;

    Hierarchy (View Summary)

    Index

    Properties

    aimVectors: AimVectors

    The "aim" and "up" vectors used when determining rotation. LookAtComponent will try to point the Aim axis of the SceneObject towards the target, while keeping the Up axis of the SceneObject pointing towards worldUpVector.

    LookAtComponent.AimVectors.XAimYUp
    
    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    true
    
    isBeingDestroyed: boolean

    Returns true if this Component is currently being destroyed. Becomes true as soon as destruction begins via Component#destroy or destruction of its owning SceneObject, before any OnDestroyEvent callbacks fire.

    Lens Scripting Version 364

    if (!script.isBeingDestroyed) {
    // Component is still fully alive
    }
    isEnabledInHierarchy: boolean

    Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.

    lookAtMode: LookAtMode

    Controls the method of rotation being used.

    LookAtComponent.LookAtMode.LookAtPoint
    
    offsetRotation: quat

    Adds an additional rotation offset.

    (1, 0, 0, 0)
    
    sceneObject: SceneObject

    The SceneObject this component is on.

    target: SceneObject

    The SceneObject this LookAtComponent targets.

    null
    
    uniqueIdentifier: string

    Lens Scripting Version 176

    worldUpVector: WorldUpVector

    The vector to be considered the "up" vector when determining rotation.

    LookAtComponent.WorldUpVector.SceneY
    

    Methods

    • Destroys the component.

      Returns void

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean