Legacy Documentation: Version 2017.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Ray

struct in UnityEngine

Description

Representation of rays.

A ray is an infinite line starting at origin and going in some direction.

Variables

directionThe direction of the ray.
originThe origin point of the ray.

Constructors

RayCreates a ray starting at origin along direction.

Public Functions

GetPointReturns a point at distance units along the ray.
ToStringReturns a nicely formatted string for this ray.

Did you find this page useful? Please give it a rating: