- Home /
Error CS0029: Cannot implicitly convert type
Can anyone tell me how to get rid of this error. i'm trying to load a 3d model from database
Error CS0029: Cannot implicitly convert type 'UnityEngine.WWW' to 'UnityEngine.GameObject' (CS0029) (Assembly-CSharp)
this is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class db : MonoBehaviour {
public GameObject model;
// Use this for initialization
IEnumerator Start () {
WWW name = new WWW ("http://localhost/projects/conn.php");
yield return name;
GameObject model = name;
}
// Update is called once per frame
void Update () {
}
What is "conn.php", and what model do you expect it to return?
The WWW class has accessors for the data types it supports loading. It does not appear to support loading models directly, you would have to use text/bytes to read in raw data, and load that into a Unity $$anonymous$$esh class manually.
Alternatively, consider looking into Asset Bundles. These will allow you to dynamically load a variety of Unity asset types. You can use WWW to load an Asset Bundle containing your model.
Thank you @bobisgod234 for reply
the conn.php is returning a 3d model(.fbx) and what i want to do is that to instantiate that 3d model in runtime