Trouble moving game object properly.

0 favourites
  • 9 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I have an object that only has 'ScrollTo' and '8Direction' on it.

    I have

    Directions: set to '8 Directions'

    Set Angle: Set to 'No'

    Default Control: Set to 'Yes'

    Initial State: Set to 'Enabled'

    The object is supposed to stop moving when the arrow key is released. Sometimes after I release an arrow the object keeps moving for what seems like forever, and sometimes it just moves for a few seconds before it stops. If I tap any arrow key while it is moving on it's own it will stop moving. Also when I change directions by pressing/releasing a second arrow it sometimes goes straight for a small distance before adjusting it's direction, and sometimes it doesn't change directions at all. It will also get stuck going at an angle with no keys being held.

    This is also happening when I removed behaviors and only had events that adjusted the objects Self.X or Self.Y while an arrow key is being held.

    Right Arrow Down: Self.X + 6

    Left Arrow Down: Self.X - 6

    ...etc

    When a key is pressed it starts acting instantly, but it is acting like there is a lag between key being held and key being released or it isn't detecting it.

    What could be causing this since there is no other objects or events interfering or associated with the object I am moving? This gave me problems in a large project, but it is also happens in an empty project.

    I don't have a bad keyboard, I would have noticed it when typing or using other software.

    I have Release 233 (64-Bit)

    I need to know what could be causing this and a solution if possible.

  • The answer is probably in how you are doing your keypress Events, but you would need to either upload a .capx or show the Events for us to know for certain, otherwise we're just making random guesses.

  • It was a full project but it still does it in an empty project with 'ScrollTo' and '8Direction' on an object. Nothing else.

    It has something to do with the keyboard.

    I added on-screen buttons and it doesn't do it with Mouse click or touch, but it still does it with key press during the same session.

    Since nobody else seemed to have brought this up it is probably just my configuration, I'm not worrying about it anymore unless it becomes an issue when exported.

  • Are you previewing in a specific browser and do you get the same problem in all browsers?

    I experienced something similar in Edge under fairly specific circumstances: .

    I'd be a bit concerned about developing a project with a core mechanic issue, personally.

  • I didn't think to test it in other browsers, should have been my first though. I am glad you brought that up.

    I use Firefox and Chrome at the same thing for different tasks. It prevents me from losing all of my tabs and log-ins when a browser crash occurs. So I usually have 6+ tabs open on Firefox and 2 or 3 tabs open at once on Chrome. I use Edge to test/debug to have faster loading and eliminate the risk of losing my Firefox/Chrome tabs when I accidentally make a bad loop.

    I did test in Firefox 48.0.1, Chrome 52.02743.116 m (64-bit) and I couldn't cause the problem to happen.

    So the problem seems to be in Edge for me.

    Edge 38.14393.0.0

    EdgeHTML 14.14393

    I put both Edge and HTML versions for Edge. Mainly because I have never seen a program with a version and a language version. So I assumed both would be needed if anybody were to try to duplicate this.

    Windows Pro 64-bit version 1607

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Unconnected,

    I think from html14 you are on win 10 anniversary update? I have suspicions this is a new issue in Edge

    PS. I can reproduce this, but on quick testing the key down fails are only on the 8-direction behaviour controls not another key that is unrelated.

  • Yes 1607 is the anniversary update.. I had trouble installing 10 and I got it to install and had to patch-fix it a lot. It finally got so bad I couldn't install software so I had to reinstall 10 and got everything going again.. As soon as I get it set they forced 1607 on me and I had trouble installing that.. I finally had to download an ISO with 1607 in it and reinstall it for the third time..

  • should have done that in the first place. btw it worked nicely for me even when upgraded

  • I was on very slow unlimited mobile hotspot at the time. It was unlimited, but the more it was used the slower it got until the month renewed. Patches where all I could do. It took me 3 days to download Windows 10 when they were giving it away for free. I managed to get fast internet when 1607 came out. I didn't have much of a choice to patch. I usually fresh install when I can.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)