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

# Rigidbody Max Angular Velocity

[Physics 3D](../index.md) / [Rigidbody](index.md) / **Rigidbody Max Angular Velocity**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :green_circle: Can Write

</div>

## Description

The Max Angular Velocity property of the Rigidbody 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("Rigidbody Max Angular Velocity")]
    [Category("Physics 3D/Rigidbody/Max Angular Velocity")]
    [Description("The Max Angular Velocity property of the Rigidbody component")]
    
    [Image(typeof(IconPhysics), ColorTheme.Type.Lime)]
    [Keywords("Physics, 3D")]
    
    [Serializable]
    public class GenTypeNumber_Rigidbody_MaxAngularVelocity : TypeNumber
    {
        [SerializeField] private GetGameObject m_Rigidbody = new GetGameObject(
            new GenTypeGameObject_Rigidbody()
        );
        
        public override double GetPreview(GameObject source)
        {
            GameObject instance = this.m_Rigidbody.GetPreview(source);
            if (instance == null) return default;
            
            Rigidbody component = instance.GetComponent<Rigidbody>();
            return component != null ? component.maxAngularVelocity : default;
        }
        
        public override double Get(Args args)
        {
            Rigidbody instance = this.m_Rigidbody.Get<Rigidbody>(args);
            return instance != null
                ? instance.maxAngularVelocity
                : default;
        }
        
        public override void Set(double value, Args args)
        {
            Rigidbody component = this.m_Rigidbody.Get<Rigidbody>(args);
            if (component != null) component.maxAngularVelocity = (float) value;
        }
        
        public override string ToString()
        {
            return $"{this.m_Rigidbody} Max Angular Velocity";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}


```

