- Home /
Can you find the length or “bounds” of an edge collider2D using Bounds?
Can you do this? I want to shoot a raycast upward from the very beginning of one end of my edge collider. I know this works with box colliders by finding the boundaries of the box collider, but will this work with edge colliders?
What sort of bounds are you expecting to get back? A rectangle would be straightforward, with you just taking the $$anonymous$$/max of each x/y component in your edge collider vertices. You could also find vertices for the $$anonymous$$imum convex polygon required to cover your collider vertices.
I want to know the exact starting point of the very beginning of either side of the edge collider. I know this is possible to do using a box collider, but I want to know if I can get the same point on a flat line (edge collider). I want to be able to shoot a raycast from this point.
While it may not necessarily be the "bounds" of the edge collider, I only described it as "bounds" because I'm not familiar with another way of finding points on a collider.