Will cast to a base class load the child classes into memory as well?

Hello, i have a question, will a cast to a base class load the child classes into memory or not?

Hi, no it will only load in the class that you’re casting to (and everything that references). So it won’t load the child classes.

3 Likes

Thanks for the answer, and if it was cast to a child class it would load the parent class as well?

Yes, if you load a child class it will load the parent as well (you can right click on any asset → Reference Viewer, then you will see what it references and therefore what will be loaded in memory when this asset will be loaded).

2 Likes

Thank you very much.