• Advertisement
Sign in to follow this  

Adding Collider To a LineRenderer - Unity3D

This topic is 1318 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys .

 

I need a collider for my line renderer , my line renderer is drawn by mouse and it may be curved .

 

Any ideas ?

 

Thanks For help .

 

Share this post


Link to post
Share on other sites
Advertisement
Well, we'll need a bit more info. What kind of curve is it? Is it a hand-drawn line? Or is it a bezier curve, controlled by points?

In the former case, you'll have a set of points where the hand drawn line passes. You may want to reduce the number of points by simplifying the curve. Start at the first vertex and traverse the line: Merge neighboring points that are close enough together or are almost on the same continuing line.

In the latter case, iterate through a bezier curve, and emit points that fit the curve at a certain resolution.

Share this post


Link to post
Share on other sites

sorry but how ?

Uh…

my line renderer is drawn by mouse and it may be curved

You know that it’s rendering a series of straight line segments right?
So if you have access to the array of points that make the line segments that create a curved render effect…


…L. Spiro

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement