Hello
I am trying to cast a ray from the camera to the information I get from a trigger stay but the ray does not travel to the centre of the object and the more dramatic the viewing angle the worse the error.What am I doing wrong here?.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class octrig : MonoBehaviour
{
void OnTriggerStay(Collider other)
{
RaycastHit hit;
if (Physics.Raycast(transform.position,other.transform.position, out hit, 333333))
{
Debug.DrawRay(transform.position, other.transform.position * 333333, Color.yellow);
Debug.Log("Did Hit");
}
else
{
Debug.DrawRay(transform.position, other.transform.position *333333, Color.yellow);
Debug.Log("missed");
}