- Home /
Passing Array to normal Raycast and using RaycastNonAlloc ¿Same thing?
So, yeah, I read the documentation, but still. I wonder There IS an overload version of the Basic "Physics2D.Raycast" where you pass a prealocated array and it returns an int with the number of hits (just like "NonAlloc" version) But it does not explicitly say that there is no allocation in the docs (like it says in the "Physics2D.RaycastNonAlloc").
So, basically ¿Does somebody know if this overload version of Raycast is actually the same or not to RaycastNonAlloc?
Thanks
Answer by brunocoimbra · Feb 28, 2018 at 07:16 PM
Physics2D.Raycast requires a ContactFiter2D, while in Physics2D.RaycastNonAlloc you pass the layerMask, minDepth and maxDepth. Internally, both make a call to the same method.
Your answer
Follow this Question
Related Questions
Help reading Profiler 1 Answer
Raycasting not behaving as expected? 2 Answers
Why isn't my RaycastHit2D working? 1 Answer
2D Raycasting to check if grounded not working 1 Answer
Shader.Parse overhead 0 Answers