Hi, I’ve got a question about actual world space position when I use this script on the game object I.ve made. (pic related)
when I click on any point on this object, the script will always spit out the location of the game object’s collider, but I want to pinpoint the exact position of my mouseclick on this one collider. Is it possible?
Thank you
void Update(){
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, Mathf.Infinity, floorMask)){
if (Input.GetMouseButton(1)){
distance = cam.ScreenToWorldPoint(Input.mousePosition);
print (distance);
}
}
}