---
tags:
    - "Physics, 3D, Kinematic"
---

# Cloth Bending Stiffness

[Physics 3D](../index.md) / [Cloth](index.md) / **Cloth Bending Stiffness**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :green_circle: Can Write

</div>

## Description

The Bending Stiffness property of the Cloth component

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    [Set]
    
    [Title("Cloth Bending Stiffness")]
    [Category("Physics 3D/Cloth/Bending Stiffness")]
    [Description("The Bending Stiffness property of the Cloth component")]
    
    [Image(typeof(IconShirt), ColorTheme.Type.Lime)]
    [Keywords("Physics, 3D, Kinematic")]
    
    [Serializable]
    public class GenTypeNumber_Cloth_BendingStiffness : TypeNumber
    {
        [SerializeField] private GetGameObject m_Cloth = new GetGameObject(
            new GenTypeGameObject_Cloth()
        );
        
        public override double GetPreview(GameObject source)
        {
            GameObject instance = this.m_Cloth.GetPreview(source);
            if (instance == null) return default;
            
            Cloth component = instance.GetComponent<Cloth>();
            return component != null ? component.bendingStiffness : default;
        }
        
        public override double Get(Args args)
        {
            Cloth instance = this.m_Cloth.Get<Cloth>(args);
            return instance != null
                ? instance.bendingStiffness
                : default;
        }
        
        public override void Set(double value, Args args)
        {
            Cloth component = this.m_Cloth.Get<Cloth>(args);
            if (component != null) component.bendingStiffness = (float) value;
        }
        
        public override string ToString()
        {
            return $"{this.m_Cloth} Bending Stiffness";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}


```

