Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Please Help

Discussion in 'Editor & General Support' started by CodyDMartin, Jun 14, 2015.

  1. CodyDMartin

    CodyDMartin

    Joined:
    Jun 14, 2015
    Posts:
    3
    I have been working on a code to make separate classes in a project i have been working on and it keeps saying (cannot implicitly convert 'BaseArcher' into 'BaseClass')

    Please help if you know how to fix and thanks ahead of time!



    Script:

    usingUnityEngine;
    usingSystem.Collections;

    public class GUIthing : MonoBehaviour {

    private BaseClass class1 = newBaseArcher ();
    private BaseClass class2 = newBaseWarrior ();

    void OnGUI () {
    GUILayout.Label(class1.ClassName);
    GUILayout.Label(class1.ClassDescription);
    GUILayout.Label(class2.ClassName);
    GUILayout.Label(class2.ClassDescription);
    }
    }
     
  2. CodyDMartin

    CodyDMartin

    Joined:
    Jun 14, 2015
    Posts:
    3
    any help would be great!!!