#pastemyst | idk

1 messages · Page 1 of 1 (latest)

jaunty moth
#

Sorry, let me take a look now.

wooden mulch
#

all good

jaunty moth
#

No errors in the console?

wooden mulch
#

nope

jaunty moth
#

kk

#

Have you tried putting debug statements in each step along the way to see where it stops running through the logic?

wooden mulch
#

yeah it doesent crash just nothing renders

#

because i tried rendering a line from the body to the world origin and that worked

jaunty moth
#

So it gets all the way to the simulatedBodies[i].position = newPos; line?

wooden mulch
#

yeah

jaunty moth
#

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.

wooden mulch
#

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

jaunty moth
#

And the renderer is enabled? I see

wooden mulch
#

im also using the same line renderer to trace out paths during runtime

jaunty moth
#

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?

wooden mulch
jaunty moth
#

You know that update only runs in editor when an object is updated, too right?

wooden mulch
jaunty moth
#

Update is only called when something in the Scene changed.

wooden mulch
#

oh

#

is there a function i should be using?

#

to maximize performance while maintaining functionality

jaunty moth
#

I would say drawing debug lines would be better

#

So it lives in the gizmos and can be toggled.

wooden mulch
#

so something similar to this :

    for (int j = 1; j < drawPoints[i].Length; j++){
      Debug.DrawLine(drawPoints[i][j-1], drawPoints[i][j];
    }
  }
jaunty moth
#

Yeah

wooden mulch
#

:0

#

it works

jaunty moth
#

Awesome

wooden mulch
#

its really intensive tho is there something i could do about that?

#

like only render when i change some paramaters?

jaunty moth
#

Hmm. Yes, I believe so. You are doing it in update.

#

You should draw it once in a loop, and then stop

wooden mulch
#

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?

jaunty moth
#

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.

wooden mulch
#

so unity doesent do it for me

#

ok

jaunty moth
#

No, I don't think so, not off the top of my head.

wooden mulch
#

whats the thing for erasing the line?

jaunty moth
#

Actually, you can't erase them, they are just timed if defined that way.

jaunty moth
#

There may be better ways of handling it in that case.

#

Should be good start, good luck.