0 Favourites

Player moves without pressing buttons

  • 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?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • How do you move the player exactly ?

  • 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.

  • 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.)

  • 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.

  • 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.

  • I dont see anything wrong yet.

    Mouse is only used to spawn that bullet ?

  • 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.

  • 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?

  • 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.

  • Update: I fixed the problem by switching the progress bar with a sprite.

    Still I think this kind of problem should be fixed by the engine developers.

  • Can you upload a capx ? So we (someone) can confirm. Must be reported as a bug then.

  • Just create a progress bar and click on it, then drag the click.

    You will notice it makes the mouse pointer change.

    I believe the problem can be solved with CSS added to the engine itself.

    'pointer-events: none;'

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
564 105,239
rexrainbow's avatar
rexrainbow
Unread hot topic
0 Favourites
[plugin] Youtube player
175 20,545
rexrainbow's avatar
rexrainbow
Unread hot topic
0 Favourites
Time to move forward?
110 9,563
GG-Works's avatar
GG-Works