title: Problem creating an instance from inherited class, C# unity
body: <p>I created a Character class with a constructor that sets a name for character and a Weapon struct containing weapon name and damage in one file. I then created a Character child class, in another file, named Paladin, containing a Weapon type variable and the constructor inherited from Character class that sets a name for the character instance and creates a new Weapon instance. When I make a new Paladin type object, in another script file, using the base constructor, Unity Prints out a CS0103 error, telling me that the name I gave to the Weapon type variable doesn't exist in the current context.</p>
  <p>I hit a huge solid brick wall. Please help. I tried everything I can think of.</p>
  <p><strong>Character class:</strong></p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class Character {
  
      public string characterName = &quot;&quot;;
      public int characterExp = 0;
  
      public Character() {
          characterName = &quot;Not assigned&quot;;
      }
  
      // CONSTRUCTOR SETTING A NEW NAME FOR THE CHARACTER INSTANCE
      public Character(string characterName) {
          this.characterName = characterName;
      }
  
  
      public virtual void PrintStatsInfo() {
          Debug.Log($&quot;Character: {characterName} - {characterExp}.&quot;);
      }
  
      private void Reset() {
          this.characterName = &quot;Not assigned&quot;;
          this.characterExp = 0;     
          }
  }
  </code></pre>
  <p><strong>Weapon struct:</strong></p>
  <pre><code>public struct Weapon {
      
      public string name;
      public int damage;
  
      public Weapon(string name, int damage) {
          this.name = name;
          this.damage = damage;
      }
  
      public void PrintWeaponStats() {
          Debug.Log($&quot;Weapon: {name} - {damage} DMB.&quot;);
      }
  </code></pre>
  <p><strong>Paladin class (character child):</strong></p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class Paladin: Character {
  
      public Weapon weapon;
  
      //CONSTRUCTOR INHERITED FROM CHARACTER CLASS
      public Paladin(string characterName, Weapon weapon): base(characterName) {
  
          this.weapon = weapon;
      }
  
  
      public override void PrintStatsInfo() {
  
          Debug.Log($&quot;Hey {characterName}, take your {weapon.name}&quot;);
      }
  }
  </code></pre>
  <p><strong>Script file doing the other work:</strong></p>
  <pre><code>using System.Collections.Generic;
  using UnityEngine;
  
  public class LearningCurve : MonoBehaviour {
  
      
      //CREATING THE PALADIN INSTANCE USING THE BASE CONSTRUCTOR
      Paladin knight = new Paladin(&quot;Osip&quot;, sword);
      
      void Start() {
    
          knight.PrintStatsInfo();
      }
  }
  </code></pre>