Line Renderer + Collider

How to add a Collider to a LineRendere ?:face_with_spiral_eyes::face_with_spiral_eyes:

Thank you

One way:

  • Create an empty Game Object
  • Add a LineRender component to the GO
  • Add a Physics Collider component to the GO
  • You’ll need to create a script that determines a proper position and size for the collider based on the LineRenderer’s start and end point.

Is that what you’re asking?

but the line will be curved …

Then you’ll need to either create it in a mesh and use a mesh collider, or create a series of box / capsule colliders. Check out the thread on the rope script that Jake has created, that might be what you’re looking for.