I can't move diagonally

In order to make your character capable of moving diagonally, you have to know a little about how movement is computed in a game application.

Whether it’s 2D or 3D, position is represented and stored in what is called a vector. In basic terms, a vector is a collection of numbers; two numbers in 2D, and three numbers in 3D. When visualizing a vector on a graph, a position vector sits between (0,0,0) and the position in question, (x,y,z)
image

Vectors are, however, not only used for position. Vectors can, and are, also used to represent directional quantities e.g. force, velocity, and so on. This is because vectors inherently contain information about two things: direction, and length.

For your intents and purposes, a vector may be used to represent the desired direction you want your character to move in. A simple example would be:

var inputX = Input.get_axis("ui_left", "ui_right")
var inputY = Input.get_axis("ui_up", "ui_down")

var direction = Vector2(inputX, inputY).normalized()

In the example above, the user’s input is used to construct a 2D vector. To maintain a length of 1, the vector is normalized using normalized().

To set the desired velocity for your character, the following code can then be used:

velocity = direction * speed

Notice how the directional vector, direction, is multiplied by a single number, speed. The multiplication is done to obtain a vector that has the direction of direction and the length of speed.
image

As a final note, games make heavy use of vectors and matrices. If you wish to become a better game creator, you have to study these mathematical concepts and learn to utilize them to your advantage.

EDIT: Here’s a link to a similar topic concerned with vectors.