|
so i took a script form a forum post,http://forum.unity3d.com/viewtopic.php?t=46222 , and changed to be used for me:
but when i added this part:
it lagged my game REALLY bad, it must e something here, just try and help me please, if more info is needed tell me
(comments are locked)
|
|
You just need to go through your code and separate the GUI stuff from the calculation stuff. Move the calculations into their own functions and then call them as needed when you press a button in the GUI. Don't move it to LateUpdate. That won't solve the fundamental issue which is just simply that you need to organize your code into sections that get called when needed instead of multiple times per frame.
(comments are locked)
|
|
Use time.timeScale = 0 when inventory is open to freeze time. That should freeze the lag but if you want to have things moving in the background of the inventory than this is not the best option.
(comments are locked)
|
|
First of all - you have to go over the code and tidy it up.... Lots of wasted CPU cycles are bad for global warming :) Second - if in fact when you add those lines it got really bad, just for kicks try and define it as a boolean and not let UnityScript figure it out by itself. See if it gives you some boost. Duck typing is fun, but has some performance loss.
instead of:
(comments are locked)
|
