unity build lag

Hello,

I have a project in which it has recently started lagging on the exports (web and windows have been verified). The lag experience is a sudden freezing of the screen, then it runs for maybe a second and repeats.

I look at the fps display and it still reads very high, 65 or more.

There is no lag whats so ever in the internal editor when it is being run.

I have tested this on multiple computers with the same results.

I have done a little debugging and found that the following line seems to toggle the massive lag: Network.Instantiate(playerPrefab, startPosition.position, startPosition.rotation, 0); This section of code has not changed recently so it is beyond me why it is all of a sudden causing lag problems.

On my part i have placed several of the playerPrefabs on the screen to see if they were the culprit. They were not.

Does anyone have any idea what is going on, or how to go about solving this?

If you have the pro version. The profiler can easily solve this im sure.

thanks for the reply,

I do have the pro version, but, how do you profile the exe? everything runs perfectly fine in the editor.

Thanks

yikes. lol. call on the pros.

Welcome to the forum, FragOnly!

Are you saying the players have previously worked smoothly but are now showing the delay with Network.Instantiate? If so, have you recently started using the Unity 3.0 beta or made any changes to the network or anything like that?

Thanks!

If by players you mean “windows standalone” or “web” then the answer would yes.

I have not changed the networking code in ages.

One of the most disturbing parts of this is it works without lag if i use it in the editor.

Any more ideas are appreciated.

I have done a lot more testing on this, and it looks like it only affects the exported binaries when they are sharing screen space. For example, using a dual screen setup, using windowed mode, or in a web browser.

If anyone has any more info or thoughts on this I am greatly interested.

Thanks

I have this problem but i can’t seem to fix it can u explain it a bit more cause my English is not that good.

in the editor everything is smooth but on the build nothing is instantiated en it lags very bad.

try remote profiler

i dont have unity3d pro is there maybe an other way

i have fixed the problem. the problem was that 2 colliders where colliding in each other.