I have:
public Class Item
{
public string name = "Stick";
}
public List<Item> items = new List<Item>();
void Start ()
{
if (Physics.Raycast(transform.position, Vector3.down, out hit, 10))
{
items.Add(hit.collider.name);
}
}
I am trying to add an item with the same name as the hit.collider. Not the collider but an item that has already been created with the same name. How could I go about doing this? Thanks