Script for character movement doens't work because of "move_and_slide()"

It’s pretty much the same as the code from this video (I know move_and_slide doesn’t have “velocity” in it, it’s not important), but for some reason It doesn’t work.

I read I’m supposed to change the velocity variable on the main node but Idk how to do that, can someone help me out?

Change your last line of code to be just move_and_slide() (capitalization is important too) and it should work if you didn’t make any other mistakes.

Regarding your last question: you did already calculate and assign a velocity Vector to the velocity property in line 18.

1 Like

It’s annoying how a single little typo can break things. :rofl:

As @wchc said, move_and_slide() should fix your problem.

1 Like

Thank you, I’ve just discovered a few days ago the importance of capitalization xd

1 Like