- Home /
How to specify which version of a method to use
Ok, so this is driving me insane.
Physics2D.Raycast contains two version of the same function which both take the same number arguments:
Physics2D.Raycast(Vector2 Origin, Vector2 Direction, ContactFilter2D contactFilter, float distance)
and
Physics2D.Raycast(Vector2 Origin, Vector2 Direction, float distance, int layerMask, float minDepth)
As you can see, they both use 5 arguments, and despite the types of the arguments that I'm passing matching exactly to the first version of the function, it always decides to use the second version. I've been trying to get this to work for about an hour and I honestly have absolutely no idea how to solve this issue.
Any help would be very greatly appreciated.
Your answer
Follow this Question
Related Questions
Unity android screen resolution 1 Answer
2D Raycast Layer Mask not working 1 Answer
Is it possible to raycast during edit mode? 1 Answer
Physics.Raycast to Physics2D.Raycast? 1 Answer
Why isn't my RaycastHit2D working? 1 Answer