Godot input states are discrete and you are having conflicting animation directives in your code.
An Example:
Your walk movement ("move_right") test is true and started, then further you test for move_right and shift key, which is also true when you try to run. In short walk and run being started in your code.
When processing inputs in godot (even input events you define as key-combos) process key-combo events FIRST and in exclusion of competing keys
if move_left & shift: run() // the combo
elif move_left: walk() // the non combo
-OR-
if move_left:
if shift: run()
else: walk()
else: some other test
In general, I find it best to simply chain all tests in this overall order:
if some-move-imagined by move_left and right pressed at the same time:
// do mystery move...
elif pressed move_left:
// test for combos and decide action
elif pressed move_right:
//
else just released yada yada
// now process jump //
if pressed jump: jump
The input code should set up your motion vectors for physics_process() and indicate that physics process has something to do with an update flag:
so the node has
- var velocity_update:Vector3
- var _update:bool
and has functions:
- input-code .. sets up velocity updating the node's velocity_update property and sets _update = true
- physics-code: uses velocity if update is true, does its thing and then sets _update to false
As I am suggesting above, don't test for inputs in physics_process() in this case because it is "expensive" with all those checks at 60 hz.
Instead put your input directives in the _input() call which will only be invoked on user input. Beyond factoring input processing from your physics processing, you will avoid bloating up physics_process() with unnecessary computation and tests. Because the call is by its nature time sensitive, it pays to be efficient in it.