Hi, I am having an issue that is really beginning to annoy me and I don’t know why it is happening. I am using unity 6.3 and have multiple projects using this one, and none of them have this issue.
Today I started a new project to try learn netcode for gameobjects. When I am using visual studio editing a script, Unity will suddenly just pop up and become the main focus making me have to click on VS again to to back to editing the script. It does this if I have a script open for a few mins, it will just bounce back to Unity.
Does anyone know what may be causing this, could it be something with the multiplayer play mode being open. Like I said this is the only project I have that has been doing this.
sounds like 3rd party code summoning focus
I have managed to catch unity before it switches, for some reason it does ‘reloading domain’ and ‘importing assets’ every time before the focus is taken away from VS and to unity. Normally this just happens to me after I save a script and click to bring Unity into focus myself. I have never had Unity do this while still in VS.
Check if there’s a Visual Studio package update in Unity. If so, install that.
This focus stealing like bugfinders mentioned is typically the doing of some 3rd party asset or package (or an editor script of yours). Ie where they implement their own file watching, and then trigger an asset refresh - because Unity would wait to receive focus to do so.
Since this only happens in one project this corroborates that situation, and should also make it easier to find suspects ie things (or settings) you don’t have in any other project.