How to cast base class as child using base class enum

I have parent item…it contains itns and bools
and that class has enum…(quest, equipment etc…
Now in other class called Equipment Show…im using prefab to show some text and item…

Now question is how to make item that is base class to a child class of equipment based of this

 if (CLone.itemtype == Item.ItemType.Equipment)
{
    CLone = Instantiate(item) as Equipment;

}

i tried to
and failed.

It sounds like the goal is to be able to display equipment variables for equipment tooltips, and quest variable for quest tooltips, etc…

This is WHY you created a base class. Define a ToolTip function in your base class, then “override” this function in your derived classes, to display the stuff appropriate to them. (lookup the c# override keyword, for more details.)

Now when you call “Tooltip” on a BItem (your baseclass), you don’t need to know what type it is- the correct version of tooltip is called automatically.

pseudo code:

class ItemBase
{
  virtual string Tooltip(){ return "";}
}
class Equipment: ItemBase
{
   float weight;
  override string Tooltip(){ return "Equipment weight: "+ weight.ToString();}
}
class Quest: ItemBase
{
   float XP;
  override string Tooltip(){ return "Quest XP value: "+ XP.ToString();}
}

usage:

ItemBase a= new Equipment();
ItemBase b= new Quest();
string s=a.Tooltip();  // s will contain "Equipment wieght"
string t=b.Tooltip();  // t will contain "Quest XP value"

Following your logic, an Item can never be an equipment but an equipment can be an item.
This make sense because if you have a car base class, and a honda and citroen,

A honda can be a car, but a honda can never be a citroen.
A honda has specific attributes, fields, properties that a base car doesn’t have so it makes sense
that a honda can’t be a car, but a car can be a honda, because a honda has the base attributes, fields, properties of a car.

You will need to make a constructor to pass your item and set the correct fields and properties that you need

so new Equipment(item); etc

But seeing that item is a monobehaviour so will equipment be so can’t you just do Instantiate(equipment);