This is easy but I couldn't find example file anywhere so I made one for reference.

https://github.com/j3du/gd4knockback

Move character with WASD
Box Blue - Static Box will knock you back
Box Red - Moving Box will knock you back
Box Green - Will slide back
Box Yellow - Will bounce back


-Don't let the boxes hit eachother. They have no script to interact with eachother and will throw error.
-If you jump on them they may bounce/slide back forever, and take you along with them.

This kind of thing will help people get into Godot a lot I feel and it's nice to see other people have the same idea, I like you're showing multiple knockback styles too. I've got a plan myself to release a couple of projects I'm working on open source at a certain stage and they will be a turn based grand campaign style game and FPS/RPG. Show people exactly how to do specific mechanics and then people can use that as their templates for the projects they're working on to get a quick start on whatever game they like.

By the way, to solve the error it would just take throwing an if statement at it and then stopping the code.