|
Hi! I'm having trouble using the mouse wheel. I have a simple rts camera control script in which I use the mouse wheel to zoom in and out. Like so:
The problem is that it works fine in the editor game window and web player but if I make a stand alone build the wheel does nothing. I also use the wheel button to focus the camera on an object and make the camera follow it but that doesn't work in stand alone either. All other controls work fine.
(comments are locked)
|
|
Input is handled in the Update loop. Update() runs as many times per frame as it can (although it is clamped to 50fps in the editor and web player). FixedUpdate() always runs at the current Time interval, default is 50fps, I believe. If you only test for input in the Fixed Update loop it is possible that 2 Update frames occur for each FixedUpdate() frame (your game is running at 100fps, in this example). If on the first Update you click, the second Update will clear that click, and then when FixedUpdate runs, it will say 'there aren't any clicks' - hence input is broken. Since the editor and web player are clamped to a lower speed, you are less likely to have this problem, however your own solution is best. Test for input in Update(), not FixedUpdate().
(comments are locked)
|
|
i have problems like this if i accidently made a change to the settings in a stand alone build of the game, at the screen that pops up before the game,so when that window pops up, look into its controls and just check its settings out, I do not, however, know if even appears there..
(comments are locked)
|

Well, I got it working though I don't really understand where the problem was. I moved all the actual camera movement under FixedUpdate and use Update just to check for button presses. I'd appreciate it if someone could explain what the problem was, so I can avoid similar problems in the future. I know FixedUpdate is called every physics step and Update every frame but...