Skip to main content

Laser

class Laser

Laser is a beam with distance, position and direction in the scene, they are mainly used for creating advanced systems like shooting a gun etc.


public class Laser

— Constructors (2) —

ConstructorDescription
Laser()Creates a new Laser.
Laser(Color color)Creates a new Laser with its color defined to be "color" argument.

— Methods (9) —

NameDescription
Color getColor()Returns the Laser color.
void setColor(Color color)Sets the current Laser color to be "color" argument.
LaserHit trace([JAVARuntime.Ray] ray)Traces the Laser passed to be "ray" argument.
LaserHit trace(Vector3 position, Vector3 direction, float distance)Traces the Laser with the current position defined to be "position" argument, direction to be "direction" argument, and distance to be "distance" argument.
LaserHit trace(Vector3 position, Vector3 direction, float distance, [PhysicsLayer] layer)Traces the Laser with the current position defined to be "position" argument, direction to be "direction" argument, distance to be "distance" argument, and layer to be "layer" argument.
LaserHit trace(Vector3 position, Vector3 direction)Traces the Laser with its current position defined to be "position" argument, and direction to be "direction" argument.
LaserHit trace(Vector3 position, Vector3 direction, [PhysicsLayer] layer)Traces the Laser with its current position defined to be "position" argument, direction to be "direction" argument, and layer to be "layer" argument.
void setShowGizmo(boolean showGizmo)Defines whether the Laser Gizmo will be activated or not to be "showGizmo" argument.
boolean isShowGizmo()Returns true if Laser Gizmo is enabled, false if not.