Legacy Documentation: Version 5.3
LanguageEnglish
  • C#
  • JS

Script language

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

Ray.Ray

public Ray(Vector3 origin, Vector3 direction);

Parameters

Description

Creates a ray starting at origin along direction.

	// Create a ray from the transform position along the transform's z-axis
Ray ray = new Ray(transform.position, transform.forward);