As the title states, I'm currently trying to make a side dash mechanic akin to the one from Megaman X with no success. I'm fairly new to Construct and not the best at coding. I've searched through the forums and haven't been able to figure out how to get this mechanic to work properly as I'm also tying in a stamina/energy cost to use the ability.
What I'm trying to do is create the ability that when the player presses the corresponding button (shift in this case), the player will perform as dashing function in the direction they are currently facing, but what I also want to do is have it move the character a short distance if the key is simply pressed and a max set distance if held.
Adding in the ability cost is a simple matter that I can tie in after its working, but I simply cant get it to function period. Currently the player sprite/box has the platform behavior attached to it. Most from what I've read is to try and use time, or delta time (not sure if same or different), and functions. Now functions I've searched and searched but I cannot figure out how to create, set-up, and call so help with that would also be helpful...
Currently I had it set to if the stamina was less than the cost the ability was un-useable (simple enough), but if it was useable I had it set to subtract the cost from stamina & if the player was facing right, then it was to ignore input, set the availability to 0 (might have been better if set up for as long as there is stamina left), simulate the direction right and change the X-vector to the max distance. Once max distance was reached, then it was set to Stop Ignore Input.
Any help on this problem would be greatly appreciated!