Unreal Engine - Inheritance Explained
Вставка
- Опубліковано 8 лис 2020
- Support the channel through donations. Crypto accepted!
PayPal: paypal.me/reidschannel?locale...
Patreon: / reidschannel
Bitcoin: 1JFwWHr4X6uAeoZadukzqKjzFBj3Qjy7Sk
Ethereum: 0x2B2Bc108F1Cc0fF899959dEF3226637787d8C3dE
Dogecoin: DNQ33YnhpWoTBokBNVkZP5ub8KTLkpyjpv
Join our community discord!
Discord: / discord
Every unreal user should watch this! :) Nice presentation Reid!
Thanks!
Now I want to see cow bullets... Or a bullet cow! Would that be a super fast cow, like a bullet train? 🤣
Super useful. Alot of people get drawn to UE because of the assets but often ignore some of the primary concepts, myself included. But taking time to really solidify them does wonders to your knowledge and abilities. Thankyou!
yesssss dude. This is an elite tutorial particularly for us programmers who understand OO already but are new to unreal engine. You are doing gods work. Subbed, liked and keep it up.
Your channel deserves WAY more subs!
great video Reids! a lot of useful information here.
I'd love to see more of these less specific tutorials covering basics of bp scripting.
Great video as always! My college is teaching Unreal this semester but at a rather slow pace, your channel has helped me big time!
Thank you so much! Very helpful!
Clear and concise, great lesson!
Excellent breakdown! Thanks!
Nice teaching skillz. Thank you!
Great tut . thank you.
Awesome as always Reid :)
Thanks :)
Thank you so much !
Every developer should learn OOP concepts they’re so important at least that’s what they engrained into my head during college.
Yes, for sure!
They are important ., I've seen some tutorials where guys have no idea about OOP and the code architecture they come up with is questionable to say the least. So yeah OOP is hella important. A reason why they spend 1 whole semester nailing it in our heads.
very helpful thank you!
It's a great video! Just like all your other videos!
thank you very much
The Init Function sets the 'RemainUses' to 'NumberOfUses right'? Great Video, i needed that.
Fantastic vid!
This PPT actually safe my life!
can you do a in-depth tutorial on Cover System or climbing system like uncharted ? Btw your tutorials are great one of the bests on youtube, keep up the great work !
Perhaps, I'll keep it in mind
Great video!
you teach very well🙂
very impressive
I like to keep my funcion 10:08 private :) - thanks for the tuts
#learning
These videos are great for anyone learning UE so thank you. I have a question though, does inherence work the same for behvior trees? Would I make a child BP for the Pawn and if so where to assign that pawn to other characters?
Great video but I would have liked to know how Events fit into Inheritance. Do Child Events run their Parent Event's functionality first? Why use Functions instead of Events?
Little tip class members are private by default, struct members are public by default.
Hey man, thank you. The noob question I have is at 22.23. Why can apple access player character to make it jump? I am trying to access different variables from different classes and get - call will always fail often. Can't get my head around who can talk to who.
Hey - I am confused about how to alter the amount of uses each food item has in the child classes (cake, apple). Any advice?
What is the blueprint casting used for? I could not find that being explained or described in this video. Is it for accessing a function or variable there?
Casting is a very wide-used practice in most programming languages. It allows you to "convert" a variable of type A to type B. But casting will only succeed if B is a child of A or A is a parent of B. This is useful to yes, access functions of variables in a child blueprint that otherwise would not be accessible from a variable referencing a parent class. It's also sometimes needed in order to pass a variable into a function that's expecting a specific type. But be careful, you cant just cast anything to anything. The thing you're casting to actually has to be the type of the thing you're casting.
For example, the animation graph's tick function provides you with the Pawn that's being animated. Since the player is a Character (which derives from Pawn), you can simply cast the Pawn variable to a Character variable w/o any problems. You can even cast it to your specific player blueprint and access variables that only exist in that blueprint. Also, it's worth noting that people like to tell you that casting is evil and bad and you should never do it. Ignore them :)
Ryan Senger
Regarding public private and protected you mention its best to restrict access as much as possible for ‘safety’. I’m curious what that refers to- as a solo dev I’m responsible for the whole project so is it safety of another programmer stomping on your code with duplicate variable type? Or is it more performant to have code only as accessible as it needs to be? As a newbie will restricting your access to code end up causing more headaches trying to locate variables? Or is it actually better to do that so you understand where everything lives and their relationships and scope? Like what I’m most curious about is the term ‘anyone from accessing it’ - is that referring to other people? Or other game objects accessing. Thanks in advance.
Hey, yeah its referencing other people but your future self is also essentially another person. Private, protected, and public dont affect performance, it just limits access to things that other classes dont need access to which makes it harder to use the class incorrectly
I'm trying to get my head around how to make a global pickup class that both my health and ammo pickup blueprints can inherit from and increment accordingly but maybe that's not as feasible as I thought it would be. I figured both would have collisions that would increment either health or ammo accordingly. A similar question would be would it be good practice to have a hp potion and a mana potion inherit from a global potion class even if they affect different properties?
I'd probably suggest making a base class for anything in ur game that is a "pickup" and put all the collision code and other shared code in there. Then you can have a function called like "OnPickedUp" which each one of ur pickups can override and do w/e they need to do when theyre picked up
criminally undersubscribed channel lol
You had me lost after saying that an apple or a cake is not a food. Why would the cast fail?
timestamp?
@@ReidsChannel Timestamp probably at the 4 minute mark, where you show, that food can cast to food and actor, but not to cake or apple, because food might not be necessarily apple or cake (could be potato). I guess, you can only cast to the same class or the next higher parent class), but not to one of the lower child classes, or to classes at the same level in the hierarchy, but that are at a different branch?