Hi, i'm trying to use the Physics.Raycast method, but I get errors saying:The best overloaded method match for 'UnityEngine.Physics.Raycast(UnityEngine.Vector3, UnityEngine.Vector3, float, int)' has some invalid arguments
.
It's strange because both itellisense and the documentation tell me that this is permitted:
RaycastHit hit = new RaycastHit();
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, hit)) {
print(hit.point.ToString());
selection.transform.Translate(hit.point - selection.transform.position);
}
Any idea?