#pastemyst | idk
1 messages · Page 1 of 1 (latest)
all good
No errors in the console?
nope
kk
Have you tried putting debug statements in each step along the way to see where it stops running through the logic?
yeah it doesent crash just nothing renders
because i tried rendering a line from the body to the world origin and that worked
So it gets all the way to the simulatedBodies[i].position = newPos; line?
yeah
And as far as you can tell the values in those positions look correct? It's just not rendering?
I'm just curious if somehow they are rendering, just not where you expect.
well im using the exact same formula to create the list of points to render as the actual formula to move the real things during runtime
And the renderer is enabled? I see
im also using the same line renderer to trace out paths during runtime
Ah I see, one moment
So I take it what you are trying to do is see the same path real time in the editor, as well as in game?
well in the editor i want to see the path that a body will take so that i can line up orbits without trial and error
You know that update only runs in editor when an object is updated, too right?
what do you mean by updated
Update is only called when something in the Scene changed.
oh
is there a function i should be using?
to maximize performance while maintaining functionality
I would say drawing debug lines would be better
So it lives in the gizmos and can be toggled.
so something similar to this :
for (int j = 1; j < drawPoints[i].Length; j++){
Debug.DrawLine(drawPoints[i][j-1], drawPoints[i][j];
}
}
Yeah
Awesome
its really intensive tho is there something i could do about that?
like only render when i change some paramaters?
Hmm. Yes, I believe so. You are doing it in update.
You should draw it once in a loop, and then stop
is this something I have to do by hand or does Unity do it for me
maybe like after im done drawing set past arguments to a variable
and unless something changes then stop rendering?
The way you would do it is store the information in some way, and compare it on update, and if those values don't match, erase the old line, and redraw it.
No, I don't think so, not off the top of my head.
whats the thing for erasing the line?
Actually, you can't erase them, they are just timed if defined that way.
oh i see