- Home /
How to let the user draw lines in a 2D game?
Hi there,
i am thinking to make a 2d game using Unity. the idea of the game is similar to
free rider. i was wondering if i could draw lines like in the game free rider(i.e when the user plays the game he could draw the lines while the game runs). if it is
possible, then how? if not, is there any other alternative or other game engine i could
use to do that?
here is the link to free rider game if you are unaware of the game- http://www.freerider2game.com/
Answer by Bunny83 · Jul 09, 2014 at 12:55 PM
The answer to "if it's possible" is simple this as it's made with Unity. However it's not as simple as it looks like. The problem is actually two-fold. You have to drawn the lines and also have to construct a collider from the drawn lines.
To draw lines there are multiple solutions to that. Either use a third party framework like vectrosity, use a line renderer or build a mesh from the drawn points.
As collider you can use the new PolygonCollider2D or, as in max and the magic marker, build a mesh collider from the points.
Your answer
![](https://koobas.hobune.stream/wayback/20220613153608im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Converting Debug.drawlines to in-game lines? [screenshot inside] 3 Answers
Issues with Sine Wave Generation and Rotation 0 Answers
Sprites have black Lines 2 Answers
Jump Function C# hassle! 0 Answers