Hello!
I have a few scripts, and some of them use Mathf.Infinity as the range of a RaycastHit. I was wondering if that is in any way bad to use; I’m thinking that since Infinity is so large, it might be performance-intensive? Is there any reason I shouldn’t use Mathf.Infinity? If that is too difficult to answer, is Mathf.Infinity bad as a range for a RaycastHit.
Thank you so much!!
1 Answer
1No, it’s just the largest representation of a floating point number.
Yes, but isn't that performance-intensive, even a little? It's quite a large number, so I just assume storing it would take more space than setting the float to, for example, 5 or so.
– Miaw666