- Home /
Standalone gets mouse input when in background UNET
Hello there, I am trying to test the new Unity Networking: - I build and run the project to Standalone - Then I start it in the Unity Editor as well When I focus on the unity editor (and leave the Standalone to background) the mouse input still gets handled to the Standalone in the background. This happens regardless of who is the server or the client - it's not networking related IMO.
I still want the standalone to run in the background but I don't want it to get any input when it is not focused. Please help. Thanks in advance.
Answer by Ibzy · Jun 26, 2015 at 08:34 AM
When checking for mouse input, are you checking if(isLocalUser)? This is what gets used to ensure you only affect your active/focused game.
I am not checking for mouse input manually - I use the FPSCharacterController. Ins$$anonymous$$d I use if(isLocalPlayer) to turn on the CharacterController and FirstPersonController on the FPSCharacter prefab which are turned off on the prefab itself.
When I build it to WebPlayer - it works fine.. but when it is in Standalone app - it gets buggy
That does sound odd. When you run the game in the editor (as well as standalone) if you check the standalone player in the hierarchy are his FPSCharacterController components definitely disabled?
Yes, I checked.. they are disabled.. it looks like in the background the standalone app still gets input information from the mouse just as it is focused(on the front of all other applications).
And where are you activating your components? Start()? Try using the below in place of your isLocalPlayer check:
public override void OnStartLocalPlayer(){
}
Hello .. tried it - still the same.. nvm I will be testing in webplayer application :) thanks for the help