How to detect with colliders while drawing line by line renderer?
I am working on a game which is based on drawing so this problem is so deadly to me. I am drawing line by using line renderer. First I store touch positions in an array and then I copy them into line positons and edge collider points. This works good. I can draw line and add colliders simultaneously. But there is a problem. While drawing line it cant interact with other gameobjects colliders or itself. How can I do it? I want to: If line interact with a special object it will stop.
Answer by tormentoarmagedoom · Sep 29, 2018 at 12:04 PM
Good day. Then the best way i think is, in each mouse click, you need to create a empty object with a collider (prefab is recommenden) to detect if there is anything there, if not, you can continue. Second thing to do, should be create a collider between this new point and the lastone , to detect if there is something in this section of the line, and the same, if dont detect other colliders, ypu can continue.
Good luck!
Bye!
Your answer
![](https://koobas.hobune.stream/wayback/20220612175434im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to detect a touch inside a GUI 0 Answers
GameObject.GetComponentsInChildren returns twice as much objects than i thought it would 2 Answers
Expanding Ring Attack 0 Answers
Android Controls 1 Answer
Line Renderer for golf game 2 Answers