I would like to request a new feature for the Gdevelop Conditions: Adding a way to check if the push of the mouse button has ended.
The problem with the current MouseButtonPressed is the transitioning between scenes with the Mouse button still down, which will automatically think the object in the new scene is pressed, and will trigger a new unwanted action.
The current workarounds are at the very least inelegant, from adding timers to every scene, to adding variables to force the button state to be unpressed. In my eyes it is not very practical to have to go through hoops for such a simple condition.
I’ve already asked for this feature few months ago in the french section of the forum.
As i said many times : it’s not only on scenes transitions, the problem also exist when you spanw another “clickable” object just after one previous objects was clicked (and destroyed). Its really boring to create tons of variables for such things, or chronometer/timed events).
Also almost every friendly UI react on release condition, not on click, it’s like a standard (like for selection text, drag and drop, even on all buttons in OS).
Also, every multimedia software i used in the past handle it : flash/director/authorware, and of course it’s checkable on the web.
It’s probably the feature i lack the most in Gdevelop.
In case I want to gather some sort of power or strength when a key is pressed (hold) and I want to run the action (hit the ball, fire the weapon, jump…etc) when the key is released based on the power or strenght gathered while the key was pressed…
True indeed that would be a use case, even if I think in this situation you would already have another thing (typically a variable) tracking the power of the attack, so you can just have an event with an inverted condition “Key is pressed” and another condition testing if the variable is not 0 (or any other relevant value indicating that the attack is being prepared).
Yes, of course it is possible one way or an other, just like many other conditions and actions currently available in GD.
It was just a case out of my head when such condition can be useful. It didn’t meant to be something impossible without such condition
Since you’ve added the Mouse Release condition, I think adding the Key Release condition is a logical move, it’s like symmetrical. Otherwise a lot of users that know about the Mouse Release will search for something equivalent in the keyboard, and will not find it
I’m sure that I’ll modify my codes to use the new Mouse Release condition, even if I don’t need it (as you suggest, invert the Mouse Pressed condition plus some variable can do the trick), because it looks a lot better for readability. And I’m sure that I would modify my codes to use a Key Release condition where I can, for the same reasons
In the other hand, you are right, surely this condition would be used much less than the Mouse Release one
My view on this is that If a single condition or action able to replace multiple line of events and variables to have the same results, it is useful to have especially in such tool that is targeting people with no experience in programming and game development and also trying to speed things up for experienced users.
Also as Lizard-13 has mentioned, it would be logical to keep events “symmetrical”, so anything you able to do you should have an option to do the opposite and if you can do it to one thing, you should be able to do it to all things.
For example I would even suggest to add object/sprite is pressed(touched)/not pressed/released condition. Again, this is one of the easiest things to do in GD and you and most people would call it useless and pointless straight away as it is already possible very easily, but if you take a look at it as a beginner know next to nothing, such “useless and pointless” (less popular) conditions would be useful to help beginners to get started and have fun while they become more experienced and familiar with GD and with game development in general.
But also could be useful for experienced people , such conditions would help to spend less time to get up and running basic things such as sprite is pressed, and key is released and get to the real thing faster.