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);
using UnityEngine;
public class ExampleClass : MonoBehaviour { void Start() { // Create a ray from the transform position along the transform's z-axis Ray ray = new Ray(transform.position, transform.forward); } }
Did you find this page useful? Please give it a rating: