Skip to content

Assets/Scripts/BaseClasses/Item.cs(78,83): error CS0039: Cannot convert type Item' to UnityEngine.GameObject' via a built-in conversion #1

@kasradzenika

Description

@kasradzenika

Hi there,

I've just cloned your repo and loaded the project in Unity 5.5.1p1. After loading, I've got this error in my console:
Assets/Scripts/BaseClasses/Item.cs(78,83): error CS0039: Cannot convert type 'Item' to 'UnityEngine.GameObject' via a built-in conversion

and here is the problematic line in Item.cs:
image

The problem is that the instantiated object is an Item which does not derive from a GameObject (but from a MonoBehaviour instead). One potential fix is to use the GameObject property of the instantiated Item:
image

Thanks,
Nika

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions