M
M
Maxim Kapralov2014-12-12 09:36:01
Unity
Maxim Kapralov, 2014-12-12 09:36:01

How to draw an arbitrary line in a 2D game on Unity?

Hello!
Please tell me in which direction to dig on this issue: we need the ability to draw an arbitrary line in a 2D game with the mouse (like with a brush in some kind of paint), and not just like that, but so that the resulting line is a game physical object.
So far I have only thought of creating clones of a prefab with a circle sprite and a collider at the moment of mouse click - is this the right direction? Or is it the way to the bottom? :D If correct, how would you make this line solid and smooth?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
smet4ik, 2014-12-12
@Byrnane

Look towards the component: LineRenderer
And examples of its use in 2d.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question