Trouble moving game object properly.

Discussion and feedback on Construct 2

Post » Sat Aug 27, 2016 1:59 am

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.
B
59
S
33
G
13
Posts: 223
Reputation: 12,105

Post » Sat Aug 27, 2016 7:14 am

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.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Sun Aug 28, 2016 12:03 am

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.
Last edited by Unconnected on Sun Aug 28, 2016 8:23 pm, edited 1 time in total.
B
59
S
33
G
13
Posts: 223
Reputation: 12,105

Post » Sun Aug 28, 2016 8:12 am

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: key-down-events-with-a-physics-tilemap-can-fail-in-edge_t180804.

I'd be a bit concerned about developing a project with a core mechanic issue, personally.
B
18
S
12
G
1
Posts: 45
Reputation: 2,340

Post » Sun Aug 28, 2016 7:47 pm

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
B
59
S
33
G
13
Posts: 223
Reputation: 12,105

Post » Mon Aug 29, 2016 7:27 am

@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.
B
18
S
12
G
1
Posts: 45
Reputation: 2,340

Post » Wed Aug 31, 2016 1:12 am

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..
B
59
S
33
G
13
Posts: 223
Reputation: 12,105

Post » Wed Aug 31, 2016 10:14 am

should have done that in the first place. btw it worked nicely for me even when upgraded
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
41
S
14
G
12
Posts: 623
Reputation: 9,359


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests