Hi,
For me,
This define the type of the variable as Vector2. It is static typing
var direction_with_colon : Vector2 # Define the type
... Some code
direction_with_equals = Vector2(3.0 , 1.0) # Initialize it.
In this case, the variable can only take the same type which was declared.
And this
var direction_with_equals = Vector2()
is dynamically typing the variable while his initialising. The variable will only take only the same type as defined.
If you want to prevent a wrong type of varible use static typing.
See Static typing in GDScript.
And in answer to your question:
I guess that for basic type like int string vector2d ...
Static typing will also initialise it with a basic value, 0, "" , ( 0.0,0.0)
But with more complex type like PacketPeerUDP, it will not be initialized and will make and error.
Correct me if I wrong.
Regards, Forman21.