Don't worry in the slightest, it's just a tip so you know in future.
The only thing that's moving your slime character is _physics_process
- and there are two conditions there. If reversing doesn't give you the result you need then the other possibility is that your condition if player and hit == true:
is evaluating true when you don't want it to.
I'm not certain what exact behaviour you're looking for with all your signalled states so I can't tell you the answer, only how to approach solving it yourself (which is more useful to you as someone new anyway).
So, you can add line breaks to debug (click on the "gutter" to the left of the code so a red dot appears) within these conditions to see when they're evaluating true and false. After line braking the code will stop at that point and if you mouse over the variables it'll say what they're value is and step forward / over if you want to see what happens next.
Or equally, if you prefer you can print the state of player
and hit
(best to do this is places where it doesn't spam it 60 times a frame but it's not a disaster if you do).
The name of the game here is to limit where the problem could be and so hone in on the part of the code producing the undesirable behaviour. Just printing / line breaking will let you know when the signals fire and the variables change. Going through this you'll soon debug the issue.
Good luck!