- Home /
Draw curved outline around two objects
Hello, I'm trying to draw a shape similar to the one attached below, around two objects so that when these objects move away from each other, the shape changes with them as seen in the sequence below. How would someone do that in unity? (Red shapes represent game object, black lines is what I want to draw)
So far I have drawn a circle around the two objects using LineRenderer but I am stuck at this point.
Thanks!
Answer by Nebukam · Apr 11, 2018 at 07:54 PM
The most future-proof approach (say, if you need to 'merge' 2+N objects in the future) would probably be to go for a metaball approach : https://en.wikipedia.org/wiki/Metaballs
Check this post for the philosophy behind building such structure : http://jamie-wong.com/2014/08/19/metaballs-and-marching-squares/
I found this tutorial on metaballs that was very useful for my project: http://patomkin.com/blog/metaball-tutorial/
Your answer
Follow this Question
Related Questions
Adjusting an angle of a collider2D to a linerenderer that is user-created 0 Answers
LineRenderer memory leak 0 Answers
Line renderer projectile trajectory in 3D world 1 Answer
Display LineRenderer over a plane instead of behind it 0 Answers
Draw shortest distance between 2 points on a sphere 1 Answer