max123 Posted December 6, 2016 Share Posted December 6, 2016 Hey, Has anyone else encountered this issue where your camera controls act like being stuck and the camera is being "dragged" in a certain direction? It's tough to reproduce, but has been reported by users of my little game and I have seen it 4-5 times myself. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 6, 2016 Share Posted December 6, 2016 Is your touch event our mouse event going off the context of the canvas. If you dont have an event to buffer for when the event leaves the context this can create this type of behavior. max123 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 6, 2016 Share Posted December 6, 2016 Are you using collisions? Quote Link to comment Share on other sites More sharing options...
max123 Posted December 6, 2016 Author Share Posted December 6, 2016 Collisions - yes, physics - no. Quote Link to comment Share on other sites More sharing options...
max123 Posted December 6, 2016 Author Share Posted December 6, 2016 3 hours ago, Pryme8 said: Is your touch event our mouse event going off the context of the canvas. If you dont have an event to buffer for when the event leaves the context this can create this type of behavior. I've kept defaults (only added AWSD keys). So - no, I'm not detecting anything to do with mouse/pointer events. What would be right way of doing it? And what should I do when I detect mouse/pointer leave? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 6, 2016 Share Posted December 6, 2016 Does it stuck without collisions? (Trying to understand where the problem is:)) Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 7, 2016 Share Posted December 7, 2016 huh got me then... Quote Link to comment Share on other sites More sharing options...
max123 Posted December 7, 2016 Author Share Posted December 7, 2016 11 hours ago, Deltakosh said: Does it stuck without collisions? (Trying to understand where the problem is:)) OK, I found a way to reproduce the bug with 100% certainty: If you hold any of your move keys, and then drag the mouse from OUTSIDE the browser window into it, it will get stuck and the camera just keeps moving forever and ever. Kinda fun, but not quite what I intended! @Deltakosh, will try to reproduce with collisions switched off. Why, do you have any suspects? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 7, 2016 Share Posted December 7, 2016 The problem you mention is because the system lost the focus and thus will never receive key up. This is a kind of "known" issue Quote Link to comment Share on other sites More sharing options...
max123 Posted December 7, 2016 Author Share Posted December 7, 2016 Are there any workarounds? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 7, 2016 Share Posted December 7, 2016 Perhaps trying to detect mouse enter/ mouse leave on the canvas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.