You are on page 1of 3

Classes as Data Types | Godot GDScript Tutorial | Ep 18 | Godot Tutorials 5/8/23 4:44 PM

Courses / Introduction-To-Gdscript / Godot-Tutorials-Gdscript-18

Classes as Data Types | Godot GDScript Tutorial


| Ep 18

Classes as Data Types | Godot GDScript Tutorial | Ep 18

PREV EPISODE NEXT EPISODE

Learning Materials

https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-18 Page 1 of 3
Classes as Data Types | Godot GDScript Tutorial | Ep 18 | Godot Tutorials 5/8/23 4:44 PM

 Article  Resource

Classes as a Data Type


A data type is an attribute of data that tells the compiler or interpreter how the programmer intends to use the data.

In Godot, GDScript classes are reference types (objects).

var example: Node2D = Node2D.new() # variable example is a Node2D data type

You are also able to cast data types:

var example: Node = Node2D.new() as Node # cast Node2D instanced object as Node

Creative Common License

Classes as Data Types | Godot GDScript Tutorial | Ep 18 video & article by Godot Tutorials is licensed under a Creative Commons
Attribution-ShareAlike 4.0 International License .

Spread the love, share this if it helped you!

 SHARE ON TWITTER  SHARE ON FACEBOOK  SHARE ON REDDIT  SHARE WITH EMAIL

Subscribe to my Newsletter
Join our newsletter and get news in your inbox! We hate spam too, you
won't get any from me :)

 Email... SUBSCRIBE

https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-18 Page 2 of 3
Classes as Data Types | Godot GDScript Tutorial | Ep 18 | Godot Tutorials 5/8/23 4:44 PM

GODOT TUTORIALS
WEBSITE RESOURCES LEGAL OTHER

Courses Godot Privacy Policy Contact Me

Trello Cookie Policy Website Info

Github Terms & About Me


Conditions
  
Disclaimer

©2021 Godot Tutorials | Website Powered by Hugo Framework

https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-18 Page 3 of 3

You might also like