Hey, so today I was wondering how should i approach checking collision on LineRenderer? I want to be able to hover over LineRenderer and get some data from it. Im currently using BoxCollider2D and rotating it along the line and using rays to get colliders data. Any other better options?
-Thanks!
You should just do the math yourself — calculate the distance between a point (the mouse position) and the line, and if that’s less than whatever you think is “close enough,” show your info. Check out Paul Bourke’s site on Point/LinePlane geometry.
1 Like