Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Initialize ObiCloth at Runtime
#1
Hi, I followed your tutorial for creating cloth at runtime. It didn't work, and it was visible in the inspector that the ObiCloth was uninitialized (there's no public method for initalizing at runtime). How do I go about this? Or might it be another problem?

Many thanks.
Reply
#2
(17-10-2018, 09:16 AM)OrangMosquito Wrote: Hi, I followed your tutorial for creating cloth at runtime. It didn't work, and it was visible in the inspector that the ObiCloth was uninitialized (there's no public method for initalizing at runtime). How do I go about this? Or might it be another problem?

Many thanks.

Hi there,

There's an included example showing how to generate the mesh geometry/topology from scratch and initialize it at runtime. You'll find it in Obi/SampleScenes/RuntimeCloth. It uses the RuntimeClothGenerator.cs sample script to do its thing.

The method used to generate and initialize the cloth is GeneratePhysicRepresentationForMesh(). Note that this is a coroutine, so it must be called appropriately using StartCoroutine(). Calling it like a conventional method will have no effect.
Reply