How to use Classes in Godot! - Intermediate Tutorial

preview_player
Показать описание
Hey guys!
In this video, I'll go over setting up and using your own custom classes in Godot 4!

TIMESTAMPS:
0:00 Intro / Showcase
0:34 How to make your own Class
2:16 What are Classes used for?
3:16 Tree class explanation
4:25 Adding a new tree (from the class)
7:05 Outro / Notes / Thx for Watching! :)

Need help with Godot?
Book a 1 on 1 tutoring session with me through Fiverr!

Thanks for watching, hope you have a great week! :)

MY SETUP:

DISCLAIMER: The above links are affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. Thanks for your support! :)
Рекомендации по теме
Комментарии
Автор

This tutorial was much easier to understand on the specifics without going too far off subject. Keep up the good work.

ched
Автор

Thank you! Very confused about classes before this but now I understand them. ❤

sebashtioon_
Автор

Good job,I want to see a video about how to do trade-off between inherit and composition in Godot.

tseyomb
Автор

this video is very well explained. I knew how to more or less use classes in c++ but when I saw a couple tutorials of them in godot I couldn't figure out how they worked. thanks to you i think I get it now. your explanation was very clear, subscribed.

kynda
Автор

Your tutorials are hands down the best out there!
I have not been able to watch all your videos, but I'm working my way through your videos one by one.
If you have not made it yet, I would love a video going in depth on Planes, Normals, dot-function, and all that jazz. With my ADHD, I'm having a really hard time grasping how this works, and I find myself debugging for hours every time I have to calculate distance, angles, and stuff like that.
Anyways, thanks for the great videos!

GabeNarwhal
Автор

So amazing that I was literally struggling with this all afternoon, I had like 4 videos up showing how to do it but not as well explained as you. You answered questions I had about this. I'm trying to use it for NPCs (if you'd ever need a topic for a video, please show us how you would go about that :D) Thank you for your video :)

do_it_like_rei
Автор

A video on building different custom resources would be awesome!

Danachew
Автор

we crave another custom resources video :)

fvhaudsilhvdfs
Автор

I always get confused on when to use composition or classes in new projects. Could you consider making a video on when to use one over the other (in a generalized manner, or course)?

Great tutorial, btw. Although I'm already used to OOP, Godot's python-like language still gets me confused sometimes

aahh
Автор

What would You say would be better for a game that spawns waves of enemies like a Tower Defense? Using Composition for the Enemy by splitting the health, take damage components or by using an EnemyBase class which will have all of those things. Still quite new to all of this and have been trying out things. If I for example add armor and maybe special abilities to the spawned monsters that would have to be used in the script for the exact monster I am going for but using these two things I mentioned should take care of the heavy lifting?
Still trying to see how things work.

PhilChilled
Автор

I feel like I'm using custom resources wrong or not getting the most out of them. In the game I'm working on, I intended to use them to pass attack data from the attacker to the target, however, I had to resort to using dictionaries instead. I'd really like to see some practical application of custom resources that shows the best use cases and their advantages.

lout
Автор

How do you give an instance of a class its own unique variable?

Sunflower-lkxo
Автор

so it's just kinda useless...what's point if i can just save a node.tscn with a script on it and attach it to other scenes that needs? cause if there's no difference then classes have no reason to exist.

Ceisri