How to block code the camera to player wasd movement?

Godot Version

4.3

Question

Hi!
I’m a total beginner to Godot.
I just discovered the Godot plugin Block Code. I am not familiar with any type of programming languages and thought that the Block Code plugin could get me started on the more technical side of game developing.

I’ve tried to get the camera to follow the player around. It moves to the sides but not triggered when I press up and down.
How it looks like in block code:

I also wonder how to tackle the block coding for jumping (it’s top down. Is there a way to let “move up” and “jump” to be separate)?

Just to clarify some more;
this is how it looks like in the node tree (both the player and the camera block code has the same structure as the picture below, but instead of “every physics step,” the player block code begins with “every frame”):

If you add the Camera2D as a child of the player it will move with the player, since children follow their parents. It does not need a script/block code to do this

2 Likes