- Home /
Why does my Windows build only detect clicks in the minimap?
Hi, I'm new at Unity and have taken a course on Coursera to start things off, however, after having successfully finished my first assignment where I had to simulate the solar system and make it so the main camera follows the planet you've clicked on, I realized that the windows build didn't work correctly. You see, there's a minimap and a main map, and you're supposed to be able to click on the planet to follow from any of the two, but it only works for the minimap... Could you lend me a hand, please? The minimap is displayed using an orthographic camera at the bottom left of the screen and the main one is done using a perspective camera and takes-up the rest of the screen. The script used on the camera is "LookAtTarget.cs" and the one used by the planets is "ChangeLookAtTarget.cs". Also, the WebGL build and pre-run work as wanted. Finally, There's an error that appears after my first click during the pre-run, it's: "NullReferenceException: Object reference not set to an instance of an object ChangeLookAtTarget.OnMouseDown () (at Assets/Scripts/ChangeLookAtTarget.cs:21) UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32) " but I don't think it's the source of the problem, it's probably because nothing is targetted at the beginning.
possibly. Eli$$anonymous$$ating every occurrence of an error should be your primary target though.