- Home /
Question by
NNNscarfo · Sep 27, 2017 at 03:18 PM ·
coroutinedistancelinerenderer
Coroutine or Distance Calc?
I want the player to be able to "trace out" a line in real time. I am using a LineRenderer to accomplish this, and I feed it a List of points to trace across. The tip of the line is controlled with a control stick rather than with the mouse, and every so often I want to mark the transform.position and add it to the list of points.
I could do this two ways. First, i could use a Coroutine to mark the position every X number of seconds, and add that to the list. Second, I could check the distance from the last point every frame and mark it off when it crosses a certain threshold. In my head, it seems like both of these accomplish the same effect if the tip is moving at a constant rate. Which one do you think I should go with?
Thank you :)
Comment