I'm not an expert at unity, so bear with me. I want to load a 3D model and apply an animation to it at runtime by using the file path. They are both FBX files and I've already been able to load the 3D model in the scene using an FBXImporter in the following code.
public GameObject Eve;
GameObject fbx;
public static string fbxPath = /*File path*/;
// Start is called before the first frame update
void Start()
{
if (File.Exists(fbxPath))
{
fbx = ModelImporter.Importer.Import(fbxPath); //Loads the 3D model from the fbx file and makes it a gameObject
fbx.transform.parent = Eve.transform; //parenting that gameObect
}
}
Now I just need to apply the animation from the other fbx file to it but I do not know how to do that. Any Help?
ps. In case you want to replicate it, I got the FBXImporter from this link: https://github.com/yuen33/FBXImporter and I got both the 3d model and animation from mixamo.