Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ObiSofbody problems in runtime with separate solver and initialized state
#2
(07-05-2019, 06:37 PM)mmortall Wrote: 1. I am not able to get it work in runtime when I have Solver separately. It seems like ObiSofbody required to have solver attached to it when it is instantiated. Because when I assign it later simulation is not working as it should. Looks like Skinner stop working.
In my application, I use lots of soft-bodies with just one solver as a prefab and I assign it in runtime for object I want to simulate. 
I've reproduces it on test scene (with blue Balls)

I'm not able to reproduce this. Make sure that you're calling the skinner's BindSkin() coroutine, or else it won't work.

(07-05-2019, 06:37 PM)mmortall Wrote: 2. I also not able to get it work when ObiSofbody is not in initialized state in prefab. And I have problems with creating prefabs with Initializing state. This is not working in prefabs preview mode (Unity 2018.3 or later). So I do initialization in runtime by using GeneratePhysicRepresentationForMesh() and it is not working for ObiSoftbody but working great with ObiCloth.

I can't reproduce any of the above either. Initializing a softbody works fine for me regardless of it being a prefab or not. Also, GeneratePhysicRepresentationForMesh() works the same for all actors, there's no reason why it should work for some but not for others. Can you provide a repro scene/project, or at least share your initialization code?

(07-05-2019, 06:37 PM)mmortall Wrote: 3. It looks like ObiSofbody and ObiSofbodySkinner are know about each other in Awake method. I expect a problems with it because Unity is not guarantie Awake method calling order.

Nope. ObiSoftbodySkinner's Awake() method only takes care of finding a default value for the "Source" property, which is the first ObiSoftbody it finds up its hierarchy. This only done for convenience when manually adding a component in editor. You're supposed to provide a soft body yourself when using it programmatically:

Code:
skinner.Source = softbody;
StartCoroutine(skinner.BindSkin());
Reply


Messages In This Thread
RE: ObiSofbody problems in runtime with separate solver and initialized state - by josemendez - 08-05-2019, 07:32 AM