- Home /
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 usually.
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?
Network.Instantiate is also giving me issues. I have a script that instantiates three 2d-planes with a small simple Jpeg for a texture. At the moment of instantiation the engine freezes for about a 1/4 second. Seems a little intense for so little a action. Anyone got any idea how to avoid this?
Your answer
Follow this Question
Related Questions
RPC sync issues 0 Answers
Network.Destroy doesn't remove objects on other systems? 2 Answers
Instantiate a random item at a random position 1 Answer
Needs help to instantiate camera as child of player 0 Answers
Network Vibration Problem 1 Answer