I have researched virtual/Override and Inheritance i have some basic knowledge on them but i felt like i needed to know more so from my research i have learn what they all mean and i am just looking for someone to read through this and correct me on anything and add any extra information i have missed.
If you dont know what virtual/Override and Inheritance is i wouldn’t advice trying to learn what they are from this as i could be completely wrong.
Inheritance - What i have gathered from this is that I created a class from the type actor and then called it a “WeaponBase” and inside of this i have the code to create a SkeletalMesh as you can only inherit things that are public or protected i added the .h code to public. When i go to make a child actor of my base class i go to “all classes” and find the class WeaponBase and make a child class of the that class since its a child class everything that is public/protected inside the WeaponBase class will be inherited by all the child classes which means that inside the child class it will also have the SkeletalMesh But as its inherited from the WeaponBase class you wont see the code in the child class.
Virtual - From researching virtual i have learnt that the word Virtual is used in front of the functions that are declared in the .h file and virtual basically says to the class that all child class of that class can access that function.
Override - I have made a flow chart to show what i mean. As you can see from the flow chart inside of the “WeaponBase” class i have a function called OnFire(); as this would be virtual as i am making a child class from the Base class using the same function name. Inside of the child class “WeaponRifle” i have a function called the same “OnFire();” because the Base class and the child class both have the same function name “OnFire();” i would use the word Override at the end so its saying to the class look up through the Inheritance Hierarchy in this case it would be Actor->WeaponBase->WeaponRifle so the override word says go up the Hierarchy until you find the same function name in this case it would be “OnFire();” and inherit everything that, that function holds
If i got something wrong i would appreciate it if you could correct me so i can see what i misunderstood