- Home /
Question by
HorseManly · Jun 02, 2014 at 10:12 PM ·
terraindynamicline rendererdrawline
Create a line between two points in 2d - a vehicle will be driving on the lines created
I'm attempting to make destructible/dynamic terrain. So far ive instantiated a bunch of point along the surface and when a collision happens the move according to the blast radius. All thats left to do is to draw a line between said points. A vehicle will be driving on the created surface. Is gizmo.drawline or line renderer a solution? do they have collision?
Comment
Answer by PAHeartBeat · Jul 14, 2015 at 12:57 PM
Line Renderer is good solution.
// LineRend is Line Renderer Componant of GameObject
LineRend.gameObject.SetActive(true);
Vector3 sp = <your start point>;
Vector3 ep = <your end point>;
LineRend.SetVertexCount(2);
LineRend.SetPosition(0, sp);
LineRend.SetPosition(1, ep);
Your answer
Follow this Question
Related Questions
How to have bottom side up terrain collision? 0 Answers
Progressively Drawing a line along a path 0 Answers
Dynamic terrain loading on one scene 0 Answers
Dynamic Terrain Loading 4 Answers
Modifying Terrain Splats Dynamically 1 Answer