When I click on the scene no ray is drawn, there are no error messages in the console.
Also my camera is set to Main Camera.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class Moverr : MonoBehaviour
{
// Start is called before the first frame update
// [SerializeField] public Transform sphere;
Ray lastRay;
// Update is called once per frame
void Update()
{
// GetComponent<NavMeshAgent>().destination = sphere.position;
if (Input.GetMouseButtonDown(0))
{
lastRay = Camera.main.ScreenPointToRay(Input.mousePosition);
}
Debug.DrawRay(lastRay.origin, lastRay.direction * 300);
}
}