- Home /
Question by
SuperRaed · Aug 27, 2016 at 09:33 AM ·
linerendererprojectilepathline drawing
How to plot a path according to a function in scene view
given a function e.g x^2 , in what ways can I draw a discrete path from point a to b with interval h, all within scene view? (pic)
do I simply run a for loop , i from a to b with step h, whenever a change in function is detected and instantiate GameObjects at f(i) ?
plott.png
(8.9 kB)
Comment
Answer by DavidWatts · Aug 27, 2016 at 10:45 AM
you can run a simple loop and use Handles.DrawLine from OnSceneGUI in an editor script. https://docs.unity3d.com/ScriptReference/Handles.DrawLine.html