Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Cloth stop working once adding another solver/mesh
#2
(24-02-2019, 09:45 AM)drorlazar Wrote: when i try to add another cloth component to the scene 

I was running into a similar issue. I started tracing the issue from an ObiHandle and found that (in my particular case) the handle was not applying its behavior because the callback delegate was not being called.

I believe this is because the ObiSolver component is using a static boolean variable('frameBegan') to track the beginning frame (since physics may tick multiple times).

However, when I spawn more than 1 cape, it's random which one will actually stay on the character's back. Consider the following code snippets; when one of the capes Enters its Update, it prevents the following capes from having their 'OnBeginFrame' delegate being called back for ObiHandles to function.

I'm curious if there's a bug or pending refactor, I'm not to a point where I can start making assumptions  Sonrisa (but this seems like a similar symptom)

ObiSolver.cs
Code:
void Update(){

    if (Application.isPlaying){
        BeginFrame(false);
        //...
    }
}
void BeginFrame(bool fixedUpdate){

    if (!frameBegan){
    frameBegan = true; //<^ only 1 solver in the scene will exhibit full behavior
        //..
        if (OnFrameBegin != null)
        OnFrameBegin(this,EventArgs.Empty);
    //...
    }
}
Reply


Messages In This Thread
RE: Cloth stop working once adding another solver/mesh - by scripts - 24-02-2019, 06:55 PM