- Home /
Please help - new game has models flickering with very little in scene. Fresh reinstall of windows and unity. Code seems fairly well optimised
Hi all, I'm really hoping there is something i can do. This issue is only happening in my game. I tried loading a cube and the 3rd person player and it was all smooth.
My game is very simple though. Its just a 3d model of a ship (fairly low poly) and a plane as background (which ive tried turning off and it still happens)
I had a harddisk failure yesterday and reinstalled windows and the geforce drivers. Its also the latest release build of Unity 2017 Suddenly since the reinstall i get this message in ALL unity projects when i load it up: Error loading launcher://unity/C:/Users/MyPC/AppData/Roaming/Unity/Packages/node_modules/unity-editor-home/dist/index.html?code=5w4ZzLyHYCqOkDRoOHvVhg008f&locale=en&session_state=d12ee72c3748cf4699abb4833fa9ebf84a2adff07b566b01179ad272cfe095d0.rg6UyYURwO5pxpJ-ye2CXQ009f#/login
But my game is super simple, and input is still immediately responsive so I dont think this has anything to do with FPS
I dont understand much in the profiler but i had a go anyway. Strangely (worryingly for me) the hiccups/flickering are coming when the CPU has its dips in activity (not any spikes). I made a screenshot of it which shows how simple the game is and also the profiler screen.
The hiccups happen seemly random, but fairly often.
Does that error have anything to do with this? What can I look for in the profiler to help me? Im totally stuck :(
EDIT: I managed to get rid of the issue literally 5 mins after posting here. LOL But its ruined my understanding of how things work. Basically you see the bit i comment out on this code as follows, before i was using deltaTime and when i stopped using deltaTime the stuttering ceases completely:
transform.position = transform.position + (forwardSpeedVec); // * Time.deltaTime);
Hmmm, but when this is done, surely the speed will differ by different devices. Also even worse for me right now, is that for some reason when i remove deltaTime, the laser shots just fall out the back of the ship instead of flying out like they were before. (The lasers are their own GameObject, which just applies a set force upon instantiated. They dont really tie into the player ship in any way other than the ship itself is what instantiates them.)
Im really confused :(
EDIT: I managed to get rid of the issue literally 5 $$anonymous$$s after posting here. LOL But its ruined my understanding of how things work. Basically you see the bit i comment out on this code as follows, before i was using deltaTime and when i stopped using deltaTime the stuttering ceases completely:
transform.position = transform.position + (forwardSpeedVec); // * Time.deltaTime);
Answer by megabrobro · Aug 08, 2017 at 04:02 PM
Ok i fixed the issue and including deltaTime still. But i dont really know why this fixed it, but the game is super smooth now so....
All I had to do was make my camera a child of the player (which is the object it is following). I changed nothing other than that and the stuttering has vanished
Your answer
Follow this Question
Related Questions
Why is there a performance discrepancy between LG G4 and iPhone 6s 0 Answers
Choppy Character Movement Unity 2D 0 Answers
Alternative to getComponent? 3 Answers
Is calling GetComponent multiple times bad? 2 Answers
Low fps in simple 3D android game 3 Answers