Hey guys! So in my project, I would like to have the exact vector3 points of the position where my pointer is intersecting with the first gameobject. So far, I was thinking to use GetPointerPosition(rayOrigin), from the interface IUsesPointer, as it is supposed to return the position of the pointer for a given ray origin. But somehow, rayOrigin.position and GetPointerPosition(rayOrigin) is getting me the same output even when I have tried is from multiple location within the game. Is their any other way to get the pointer position?
Hi @KushMathur, You'll want to add IUsesRaycastResults and use the GetFirstGameObject method. https://github.com/Unity-Technologi...tionalityInjection/IUsesRaycastResults.cs#L22 Hope that helps.
Hi @amirebrahimi_unity , Thank you for your quick reply! I did tried it out but GetFirstGameObject() would be good if I would like to select the gameobject through which my pointer intersects? In my case I wish to get the vector3 coordinates of the point where my pointer intersects any of the gameobjects. I tried to use this code Code (CSharp): var pointerPosition = this.GetPointerPosition(rayOrigin); Selector = new Ray(pointerPosition, rayOrigin.forward); RaycastHit hit; if (Physics.Raycast(Selector, out hit)) { Holes[3] = hit.point; } And it is working so far. Would their be a better way out? Thanks!