Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

Ray.Ray

Switch to Manual
public Ray(origin: Vector3, direction: Vector3)

Parameters

Description

Creates a ray starting at origin along direction.

	// Create a ray from the transform position along the transform's z-axis

var ray = new Ray (transform.position, transform.forward);