Skip to main content

Laser

Complete API reference for Laser, including constructors, attributes, virtual attributes, and methods.

Package: JAVARuntime

Category: Laser

Component: no


public class Laser

Constructors

SignatureDescription
Laser(Raycast)Executes Laser and returns after the underlying engine call finishes.
Laser()Creates a new instance of Laser.
Laser(Color)Creates a new instance of Laser.

Attributes

NameTypeDescription
raycastRaycastRepresents the raycast value stored on this instance. Read or assign to update the property.

Virtual Attributes

NameTypeAccessDescription
calculateFaceUVbooleanget/setReturns whether the laser should try to calculate the UV of the face at the hit point.
colorColorget/setReturns the color shown in the editor when the Laser hits something.
determineHitColliderbooleanget/setReturns whether the laser should try to find out which child collider was hit.
noHitColorColorget/setReturns the color shown in the editor when the Laser hits nothing.
showGizmobooleanget/setReturns whether the gizmo (laser visualization) is shown in the editor.

Methods

SignatureReturnsDescription
trace(JAVARuntime.Ray)LaserHitTraces a laser using the specified Ray.
trace(Vector3, Vector3)LaserHitTraces a laser from a specified position and direction.
trace(Vector3, Vector3, float)LaserHitTraces a laser from a specified position and direction, with a defined maximum distance.
trace(Vector3, Vector3, float, PhysicsLayer)LaserHitTraces a laser from a specified position, direction, and distance with the indicated PhysicsLayer.
trace(Vector3, Vector3, PhysicsLayer)LaserHitTraces a laser from a specified position and direction, in the indicated PhysicsLayer.
traceAll(JAVARuntime.Ray)List<LaserHit>Traces a laser using the specified Ray and return all collisions.
traceAll(Vector3, Vector3)List<LaserHit>Traces a laser from a specified position and direction and return all collisions.
traceAll(Vector3, Vector3, float)List<LaserHit>Traces a laser from a specified position and direction, with a defined maximum distance and return all collisions.
traceAll(Vector3, Vector3, float, PhysicsLayer)List<LaserHit>Traces a laser from a specified position, direction, and distance with the indicated PhysicsLayer and return all collisions.
traceAll(Vector3, Vector3, PhysicsLayer)List<LaserHit>Traces a laser from a specified position and direction, in the indicated PhysicsLayer and return all collisions.
traceSphere(JAVARuntime.Ray, float)LaserHitTraces a sphere sweep test laser using the specified Ray.
traceSphere(Vector3, Vector3, float)LaserHitTraces a sphere sweep test laser from a specified position and direction.
traceSphere(Vector3, Vector3, float, float)LaserHitTraces a sphere sweep test laser from a specified position and direction, with a defined maximum distance.
traceSphere(Vector3, Vector3, float, PhysicsLayer, float)LaserHitTraces a sphere sweep test laser from a specified position, direction, and distance with the indicated PhysicsLayer.
traceSphere(Vector3, Vector3, PhysicsLayer, float)LaserHitTraces a sphere sweep test laser from a specified position and direction, in the indicated PhysicsLayer.
traceSphereAll(JAVARuntime.Ray, float)List<LaserHit>Traces a sphere sweep test laser using the specified Ray and return all collisions.
traceSphereAll(Vector3, Vector3, float)List<LaserHit>Traces a sphere sweep test laser from a specified position and direction and return all collisions.
traceSphereAll(Vector3, Vector3, float, float)List<LaserHit>Traces a sphere sweep test laser from a specified position and direction, with a defined maximum distance and return all collisions.
traceSphereAll(Vector3, Vector3, float, PhysicsLayer, float)List<LaserHit>Traces a sphere sweep test laser from a specified position, direction, and distance with the indicated PhysicsLayer and return all collisions.
traceSphereAll(Vector3, Vector3, PhysicsLayer, float)List<LaserHit>Traces a sphere sweep test laser from a specified position and direction, in the indicated PhysicsLayer and return all collisions.