- Home /
Where i can find detailed description of Unity C# function?
Hi all! I come across the string in the script in video tutorial about 2D:
Physics2D.OverlapCircle()
Where i can find what type of value will return OverlapCircle? Is it a float, bool or may be object? In offcicial Scripting Reference OverlapCircle described as Collider2D which is just basic class for 2d physics. Declaration of OverlapCircle doesn't help either.
From the script in video tutorial it is obvious that OverlapCircle will return bool. But how i can find out this fact from unity documentation?
Answer by nasa8 · Feb 17, 2014 at 11:02 AM
Why do you think it's bool?
It is everything correct in official Scripting Reference. As you can figure out there OverlapCircle returns Collide2D type. but the construction like
if (OverlapCircle(...)) {}
will work because it checks whether the result is assigned or not.
Answer by whydoidoit · Feb 17, 2014 at 11:04 AM
It returns the collider that was overlapped or null if there was no overlapping collider. So it returns the Collider2D on the object that is hit.
Your answer
Follow this Question
Related Questions
Having issue with Physics2D.OverlapCircleAll returning incorrect collider 1 Answer
Distribute terrain in zones 3 Answers
Where i can find detailed description of Unity C# funtions? 1 Answer
Multiple Cars not working 1 Answer
only one command is executed after "if" statement, rest are ignored? help! 1 Answer