Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Set Cloth Properties with script
#4
(09-04-2021, 11:07 AM)orestissar Wrote: Hey again, and thanks for the reply.

The code below gives me this error in console:

NullReferenceException: Object reference not set to an instance of an object
CreateObiBP.Start () (at Assets/Shirt and Pants/Shirt/CreateObiBP.cs:36)

Code:
var skinBatch = skinConstraints.batches[0];

If line 36 in your script is that one, it means skinConstraints is null. This can only be null if:
a) your blueprint hasn't been generated yet. Not initialized --> no constraints.
b) your blueprint is not a ObiSkinnedClothBlueprint.

Check the manual for info on how to create and generate a blueprint at runtime:
http://obi.virtualmethodstudio.com/tutor...ctors.html

(09-04-2021, 11:07 AM)orestissar Wrote: Also, im not sure i understand the exactly logic behind the iteration below.

Cloth is made of particles, generally one per vertex. Each particle in the cloth has one skin constraint, that restricts its range of movement relative to the skinned mesh. If you don't iterate trough them all, you're setting values just for one of them.
Reply


Messages In This Thread
Set Cloth Properties with script - by orestissar - 08-04-2021, 02:33 PM
RE: Set Cloth Properties with script - by josemendez - 09-04-2021, 11:14 AM