Post by formatec on Feb 25, 2020 0:09:04 GMT
We scan and modelize real peoples from our school.
Than, we use invector adon for mobile and create litle easy levels. The fun come from the fact that they knows one another in real world.
In this video, there is a working sample.
All the characters team (as companions or ennemies) should be choose from a menu list.
From the editor, all is correct. In the screen captureyou can see that we have just put a prefab of the customized player. which contains the mesh and the rig. Then we change the avatar of the invector vThirdPersonMelee and IT WORKS !!
BUT,
BUT,
BUT.......
When we try to make the same by instantiating the prefab from an asset, he desperately stay in the T-POSE. And we give the good avatar from editor. we'll have to retrieve the avatar name from the bundle too... :-(
public class santonsLoader : MonoBehaviour
{
public string bundleURL;
public Transform spawnLocation;
private GameObject newPrefab;
public GameObject vThirdPerson;
AssetBundle bundle;
// initialisation
IEnumerator Start()
{
WWW www = new
yield return www;
if (www.error != null)
{
throw new System.Exception("Tere is an error :" +
}
bundle =
}
public void Spawn(string assetName)
{
if (assetName == "")
{
Instantiate(bundle.mainAsset);
}
else
{
// Instantiate(bundle.LoadAsset(assetName));
newPrefab = Instantiate(bundle.LoadAsset(assetName), new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
newPrefab.transform.SetParent(spawnLocation.transform);
newPrefab.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
}
}
{
public string bundleURL;
public Transform spawnLocation;
private GameObject newPrefab;
public GameObject vThirdPerson;
AssetBundle bundle;
// initialisation
IEnumerator Start()
{
WWW www = new
yield return www;
if (www.error != null)
{
throw new System.Exception("Tere is an error :" +
}
bundle =
}
public void Spawn(string assetName)
{
if (assetName == "")
{
Instantiate(bundle.mainAsset);
}
else
{
// Instantiate(bundle.LoadAsset(assetName));
newPrefab = Instantiate(bundle.LoadAsset(assetName), new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
newPrefab.transform.SetParent(spawnLocation.transform);
newPrefab.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
}
}
Any help would be greatly appreciated.
Thanks in advance.
Klaude.