It works perfect for the keyboard input, and mostly fine for the mouse, except for when I do a double click, it shoot two times and stop shooting, even if the mouse button is still pressed.
So, did I missed something about double click handling or stuff?
I’m having the same problem, except I’m working in 2D with _unhandled_input and a timer to space shots. I press twice quickly, it shoots twice and then Input.is_actualy_press("fire") on where fire is bound to LMB reads false. If I extend the time between shots and press twice farther apart, it works as expected.
================================================ Used your code, got the same buggy results in Godot 2.1.4.
Used your code, and it worked correctly in Godot 3.0 alpha
The following is for 2.1.4 :
================================================
Upon holding Left Mouse button (after double-click)
it is not returning true for Input.is_action_pressed( "my_action" )
but after that, when you release Left Mouse it does return true for event.is_action_released( "my_action" )
Compare to using this same code
holding single-click or holding space bar :
returns true for .is_action_pressed( "my_action" )
returns true for .is_action_released( "my_action" )
---------------------------------------------- Link to .gif on Imgur
Recap of Apple Horo’s problem
---------------------------------------------- Link to .gif on Imgur
Here is a workaround.
An alternate way to script this in Godot 2.1.4
----------------------------------------------
Here’s the code from the 2nd .gif
One way to work around this.
Requires Left Mouse Button added to Input Map for “shoot”
I added this to a Control node in the .gif,
but it’ll work with any Node subclass
----------------------------------------------------------------------- How to format .gd scripts you find online to fill in the TAB characters -----------------------------------------------------------------------
1. Select a tab character in Godot → Ctrl+C
2. Ctrl+R → replace 4 spaces with the Godot with Ctrl+V tab character
3. click “Replace All” a few times