- Home /
OnMouseOver when short distance away.
Hopefully this one doesn't break the internet!
I have a number of objects in my game where OnMouseOver is displays a GUI.Label with the name when near enough. All of this works just fine until I get 'too close' to the object.
For example - I have a small item that rolls, when it is within '4' (I have a constant Debug.Log printing the distance between Player and Object) the label shows as expected. When the object is closer than 2.5 the label stops showing on mouseOver.
I have checked with Debug Logs and discovered it is OnMouseOver that is not firing when a short distance away from the object, not the Vector3.Distance.
I am using the standard first person controller asset with the MouseLook Y on the Main Camera (as default). I switch to XandY on controller but have since switched back - could I have missed a setting which causes this to work differently?
Thanks
Answer by Ibzy · Feb 09, 2014 at 03:07 PM
For those that have a similar issue in future:
Just reset my player character camera to that which comes with the standard asset FPC camera and the problem has gone away - looks like setting the near clipping to 0.01 (as low as I could) was the problem, set to 0.3 works like a charm.
Your answer
Follow this Question
Related Questions
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
Can't use camera.main [SOLVED] 1 Answer
Can't use trackpad to look around while moving in my first person game 2 Answers
How to make a mesh into a FirstPerson Character? 2 Answers
How to get the mouse X and Y compared with center of screen 1 Answer