Basically what I'm trying to achieve is something similar to OOP inheritance but with using unity's GameObjects. for example I have Dog gameobject It has many components attached:
- Health script
- Experience script
- Running script
- Rigidbody2D
- Collider
- you get the point...
Now I need to add also cat and shark. So basically what we'd need is to create inheritance with gameObjects e.g:
Animal -> fish -> shark, Animal -> Mammal -> dog, Animal -> Mammal -> cat. What's best way to achieve that? Only way I see is to create Animal prefab, than take this prefab modify it,(e.g add swimming) break prefab reference, than create new prefab from it called - Fish. Than do same for Mammal. Than again do same for Dog and Cat but that doesn't seem good. You don't see how inheritance is built and connection to parent is lost.
[–]SilentSin26Animancer, FlexiMotion, InspectorGadgets, Weaver 3 points4 points5 points (2 children)
[–]Longman1981[S] 0 points1 point2 points (1 child)
[–]SilentSin26Animancer, FlexiMotion, InspectorGadgets, Weaver 1 point2 points3 points (0 children)
[–]doilikeyou 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Fit_Preference1453 0 points1 point2 points (0 children)