- Home /
Question by
NumberZero_X · Nov 29, 2017 at 04:05 AM ·
scripting beginnerinheritance
Inheritance - Need Both Scripts Attached?
Hello,
Sorry if this is a silly question. When designing a class that inherits from another class, I'm wondering if the base script (parent class) has to be attached to the same object as the child class? Or can you just attach the child class to the object without the parent?
For example, if I were making a Pokemon card game, and I had a parent class called "Card," and then a child that references Card called Pikachu, would I have to attach both scripts to the object, or just Pikachu?
Thanks!
Comment
Best Answer
Answer by text23d · Nov 30, 2017 at 07:10 PM
no need. if in code you make reference to some class, it searches for files (classes, including parent) in all files in project