In GDScript, variables can be declared using the var keyword.

  • Declare a variable: var my_variable = 10
  • Change the value of a variable: my_variable = 20
  • Declare a variable with a specific type: var my_int: int = 5

Here are some common data types in GDScript:

  • int: Integer numbers
  • float: Floating-point numbers
  • bool: Boolean values (true or false)
  • String: Text strings
Comments