
It looks like you're new here. If you want to get involved, click one of these buttons!
does anyone know how can I draw line using line renderer between 2 closest objects with the same tag in unity? I have no idea at all how to do it. all I could find on internet wants me to join 2 objects with different tags or doesn't work with my game at all. I'm trying to do maps like spore space stage and need to connect lines between systems
Answers
First you will need to find two closest object with same tag and then draw a line renderer between them
You can store all the objects in an array and then loop over them and find the distance between them. When you get the shortest distance, store two objects and then draw a line renderer between them.