I’m trying to draw a line on my circle to show the score for a kids game. I got the center of the circle(startPosition) and the point on the circle where it is supposed to draw to (endPosition).
LineRenderer has some limitations. Like you cannot attach more then 1 LineRenderer to a GameObject, for example. You can of course dynamically create a GameObject with the LineRenderer from a prefab and setup LineRenderer appropriately for that instance (points + materials). Also, your game looks like 2D. Not sure if LineRenderer is appropriate here. If it is 2D are you using any of the 2D packages like Orthello?
I am building a 2D game. I just started to use lineRender for a laser. I find it works well in terms of being able to set the two positions of the laser (start and end) gun nozzle, enemy hit point. What would you suggest as an alternative @cdevl? And why?
The reason LineRenderer does not seem like a natural solution here because it is a 3D artifact. You would need to do some additional calculations with camera to position it correctly (unless your game is “pseudo 2d”; with fixed view from above into a fixed plane). Unfortunately, looking around it does seems like LineRenderer would be the best “free” solution. I didn’t realize that free version of Orthello did not include line drawing. The paid add-on does :). If you have a paid version of Unity (I don’t) you can try this: