Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'ObiCloth' does not contain a definition for 'VolumeConstraints'
#1
Hey,

I've tried to use the code I found on Obi's website to add pressure to my object, but I got the following error message:

Assets/_Scripts/Inflator.cs(24,15): error CS1061: 'ObiCloth' does not contain a definition for 'VolumeConstraints' and no accessible extension method 'VolumeConstraints' accepting a first argument of type 'ObiCloth' could be found (are you missing a using directive or an assembly reference?)

Here is the code:

Code:
using UnityEngine;
using Obi;

[RequireComponent(typeof(ObiCloth))]
public class Inflator : MonoBehaviour {

    ObiCloth cloth;

    public float inflationSpeed = 0.25f;
    public float maxPressure = 2;

    // Use this for initialization
    void Awake () {
        cloth = GetComponent<ObiCloth>();
    }

    // Update is called once per frame
    void Update () {
        cloth.VolumeConstraints.overpressure = Mathf.Min(cloth.VolumeConstraints.overpressure +
                                    Time.deltaTime*inflationSpeed,maxPressure);
        cloth.VolumeConstraints.PushDataToSolver();
    }
}

Many thanks
Reply


Messages In This Thread
'ObiCloth' does not contain a definition for 'VolumeConstraints' - by yeyoya - 27-08-2020, 09:11 PM