I need to be able to draw a line from a gameobject that goes off infinitely (or to a really large point) and is aimed with a mouse, kind of like a bubble shooter game. I’ve been looking everywhere and none of the LineRenderer or Raycast2D tutorials really help me with this. Also, if I were drag and aim as if it were on mobile, how would I go about doing that?
I’ve heard so much about Vectrosity but I’m not sure if it would be too much of use to me. All I want to do is simply make an aim line from an object. Can you show me what a line of code in Vectrosity would look like if I were to achieve my goal?
The Vectrosity API is a much-refined version of what Unity’s LineRenderer component is: you give it an array of points, tell it some other parameters, and presto it makes the line appear for you.
You could also iteratively put a series of sprites in a line like that, bouncing off the wall, etc. That might be easier.
I wouldn’t worry about efficiency until I have something actually working. Unity won’t break a sweat doing a bubble shooter unless you make some really grievous errors, most of which have been documented by those who went before you.