Make the "Dash" go straight

I am making a game which is simiar to MMX. So I made this:

But when I test it in the preview, the player doesn’t go straight, it goes a little bit to the diagonal upwards. Can someone help me?

Did you try doing action “Stop All Forces” before the Dash is triggered?

Just tried it out here, by adding “Stop the Object” before the dash is triggered, fixed the Up Dash, now the Up Dash goes straight, but the horizontal dash still goes slighty to the diagonal, going a little bit up.

Tried Stop All Forces before the horizontal dash?

Yes, but it didn’t worked.

Just figured out why it was going up, the jump is doing that force. But still, how do I stop that force? I already tried setting jump speed to 0, jump sustain time to 0, but nothing works.

Could try Stop All Forces on Up key Released

I already tried, it didn’t make nothing. The problem is that when I do a Horizontal Dash, it goes up. If I jump and Imediatly press the dash button, the player goes into diagonal.

Or do you mean stop all forces before the jump? Because that didn’t worked.

Did you try doing an instant force in the opposite direction on jump key released?

Wdym? Doing an opposite force like, pushing it downard before the dash?
Sry I’m a little confused

No worries, … yes that’s what i mean as you said try pushing it back down with a instant or perm force when you release the jump key

Somewhat like this?

(Spoiler: It didn’t work)

That’s what I meant… Shame it didn’t work… There’s probably an easy answer which someone who has more experience with forces will spot…

Could try changing the gravity for a moment so that the negative gravity drops the player back down… and then set gravity back to normal… probably a silly solution though… If you’re ok to share the project file I might (or might not) be able come up some other ideas…

1 Like

Thanks so much for your attention, just tried it out, and It didn’t work. At least I think, because I made what I thought you meant. (sry) But anyway, here’s the project file. Maybe you will make a solution.
Anyway, thx.

Ok I’m taking a look now… explain to me what the problem is… You don’t want player to go diagonal when you press the space and dash key… you want player to dash straight up?

Yeah, I when I dash (specifically when I’m in jumping state), the player goes slighty diagonaly to the up. I want the dash to be 100% straight horizontal.

So you want player to stop mid jump, as soon as you press the dash key, and instead of going up you want the player to then go horizontal?

Yes, Just like Mega Man X. Specifically the X7 and X8. Which there is an air dash. If you see some gameplays, the player is in the air and then he dashes, and after a moment he stops dashing and goes to his original state. The only difference of my game and X8 is that I want the player be able to dash ONLY when he is in the air.

Ok try making these changes see if it’s closer to what you had in mind

Ok, I made those changes, but now the player goes slighy down.
I want the dash to be completely imovabble, not being affected by gravity, by other forces. Sorry if I’m being to exigient? I just can’t find the best way of doing this in GDevelop