Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Missing Ref Exception when deleting Obi Cloth
#4
Hi there!

I've been testing your code, but I'm so far unable to reproduce the issue. This is the setup I have:

- Created an AssetBundle out of a few cloth prefabs.

- Empty scene, one GameObject with your script (named BundleLoader). Added a call to LoadOutfitAssetBundle() in its Awake() method, added a couple calls to LoadOutfitBundlePrefab() in Update(), passing different prefab names whenever I press various keyboard keys like so:

Code:
public void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
           LoadOutfitBundlePrefab(prefabs[0]);

        if (Input.GetKeyDown(KeyCode.B))
           LoadOutfitBundlePrefab(prefabs[1]);
       
//....etc
    }

- Created a ObiSolver+FixedUpdater GameObject, passing it to your script as the "FemModel". This way, prefabs are instantiated under the solver and simulated right away.

- Run the scene, press the prefab keys at random to load a new prefab each time, unloading the previous one. Works fine, no errors pop up.

can you spot any appreciable difference with what you're doing?
cheers,

Quote:If I call the DeleteClothingItem separately everything works fine. It's only when calling DeleteClothingItem while InstatiateObjectFromBundle in same method that the error and subsequent crash occurs.

I don't see any difference when calling them separate + together. Unless they're called at different points in time (different frames, by using a coroutine, or just calling them in response to different user input) there's no actual difference in calling them in the same method or different methods.
Reply


Messages In This Thread
RE: Missing Ref Exception when deleting Obi Cloth - by josemendez - 02-03-2021, 08:20 AM