Player moves without pressing buttons

Get help using Construct 2

Post » Thu May 19, 2016 2:12 pm

Hello,
I am having a problem when I click on the terrain for a top-down shooter.
The player is intended to just shoot, but while dragging the click, he starts moving at that direction without stopping if any of the WASD keys is pressed.
How can I prevent this?
B
25
S
7
G
1
Posts: 200
Reputation: 2,530

Post » Thu May 19, 2016 2:28 pm

How do you move the player exactly ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu May 19, 2016 2:33 pm

GSquadron wrote:Hello,
I am having a problem when I click on the terrain for a top-down shooter.
The player is intended to just shoot, but while dragging the click, he starts moving at that direction without stopping if any of the WASD keys is pressed.
How can I prevent this?



It would save on pointless guesswork if you either provide a .capx or screenshots of your events.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
87
Posts: 5,498
Reputation: 60,282

Post » Thu May 19, 2016 3:30 pm

I move the player with WASD and move the mouse to aim, then click to shoot. While moving aim, you might drag the aim and shoot+move makes the player move toward that direction, getting stuck.

This is the player group. (I cut off 20 and 21 but they were for the door/walls.)
Image
B
25
S
7
G
1
Posts: 200
Reputation: 2,530

Post » Thu May 19, 2016 3:38 pm

Does the player has another behaviour attached? Besides the 8direction.

If not. Press CTRL+F when in the eventsheet. On top you see the search box. Search on "player" you might have pasted an action by accident somewhere in the event sheet.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu May 19, 2016 3:46 pm

Ok, so what I found out is that after removing the progress bar completely solves the problem.
Looks like there seems to be a problem while dragging the click on the bar.
All enemies have health bar though, also the player has his own health bar.
How to disable the click on the bar?

@99 The player has 3 behaviors.
8direction.
ScrollTo.
BoundToLayout.
B
25
S
7
G
1
Posts: 200
Reputation: 2,530

Post » Thu May 19, 2016 4:47 pm

I dont see anything wrong yet.

Mouse is only used to spawn that bullet ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu May 19, 2016 4:59 pm

Yeah. That is the only mouse Event I use in the entire game.
I kind of fixed the problem by making the progress bars and text boxes smaller.
Looks like it must be both of them, that after drag, the cursor becomes a text one.
Then the problem happens.
The problem is not entirely solved, but bit more difficult to happen.
B
25
S
7
G
1
Posts: 200
Reputation: 2,530

Post » Thu May 19, 2016 5:18 pm

hmm ... Why a text box ? Should be text. Two differend objects. Well i suppose you dont need the user to input text there. Nah, you mean Text plugin eh?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu May 19, 2016 6:58 pm

Just checked it and it is just a text.
Ok, so it looks like this problem happens only when you drag over the progress bar.
I found another similar question and they said to make an invisible object on top of it.
It does not work for me though.

I also tried the onclick event of the progress bar, to set the cursor of the mouse to normal.
Unfortunately, it works only for click, not drag.

Also, just tried the 'every tick' 'set cursor to normal' and it does not work too.
(even though the cursor seems to continue to show as selecting text)

Update: I just opened a new project with a progress bar in it without events and seems like to be an issue.
So now I know 100% is the progress bar.
B
25
S
7
G
1
Posts: 200
Reputation: 2,530

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests