Variable Basics (Outdated) | Godot GDScript Tutorial | Ep 1.1

preview_player
Показать описание

In this episode, I look into the basics of creating variables in Godot GDScript.

Mistake 1:32 : capital S for String data type is the correct way

✅ Github Project File:

Godot Tutorials
----------
🌸 Website:

🐦 Twitter:

Resources
----------
🎮 Godot Game Engine Tutorial Series:

💻 GDScript Fundamental Tutorial Series:

🐥 Trello Page with other Godot Channels:

In this episode, I cover the following topics:
- Variable Declarations in Godot GDScript
- Typed Variables
- When to Use Variables

This is part of a beginner's programming series called the GDScript Fundamentals Tutorial Series.
Рекомендации по теме
Комментарии
Автор

Don't forget to download the supplementary GitHub file for coding examples!

GodotTutorials
Автор

Thank you! These tutorials are so helpful!

guy_incognito
Автор

Using typed variable also improves performance in godot

vickylance
Автор

Great tutorial, keep up the good work! :)

ii-valiance-ii
Автор

Hi, thank you for this! question: at 2:05 and another place, the string '10', are they supossed to be double quote " " or single quotes ' ' ? or does it not matter? thanks!

pinnapole
Автор

Good Job, I just would like to point out that there are a couple of alternatives to your methods. Typing alternative: var lifePoints: int = 100 works however according to the docs that example is for default function parameters. The other way is var lifePoints := 100 as int or var lifePoints := int(100) also works and it's the example given and is preferred, by me, for one explicit reason I can give and really the main reason for my suggestions; try typing a multi-dimensional array, I have not found another way other than var aArr := Array(Array()), even though it really doesn't type the Array index as Array but more for code clarity on intention.

Casting alternative: int(some_var) also works the same as some_var as int, but only for built-in types not nodes, other than maybe Object() but I think that would be too bloated.

shawnshipton
Автор

Sorry, but i dont quite understand what you mean at this part at 4:40 can someone please explain? thanks!

nathannicolas
Автор

thank you so much I just started making games and this helps a lot (:

kangy
Автор

4:27 goes from 0 to 100. I have no idea what an object is, nor a subtype, nor a class. You introduced three concepts that have not been explained at all to give an example of a higher order.

sonnyobrien
Автор

For eg : if I'm writing var player health : float = 10.00 as float then I don't need to write : float in between sentence right

smp
Автор

Noob here. Strings use quotation marks right? in 3:32 the string literal uses '' instead. . . can somebody explain qwq

rsserose
Автор

Interaction comment thanks for making the series

dustinwills
Автор

How do you add a sprite to a variable? I can't figure it out.

jessicaherrera
Автор

Alright, so from what I understood, I should use:
var someName = someLiteralValue
when I don't care if the variable changes its type at some point or am planning on it happening, and:
var someName := someLiteralValue
when I want the variable to always be of the same type as the initial value.
And if I don't do this and the variable type that shouldn't change does change, it's gonna be absolute bugs galore. Bugs like for example the game trying to execute mathematical operators on string type values. Did I get it right?

gusiap
Автор

I didn't understand a thing at 4:27

smp
Автор

So are variable are like prefabs in unity

smp
Автор

The audio on this is very quiet compared to the previous one.

rontarrant
join shbcf.ru