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

# Rigidbody Rotation

[Physics 3D](../index.md) / [Rigidbody](index.md) / **Rigidbody Rotation**

## Description

Compares the Rotation property of Rigidbody component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Rigidbody |  |
| Value |  |

## 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
{
    [Title("Rigidbody Rotation")]
    [Category("Physics 3D/Rigidbody/Rotation")]
    [Description("Compares the Rotation property of Rigidbody component to another value")]
    
    [Image(typeof(IconPhysics), ColorTheme.Type.Lime)]
    [Keywords("Physics, 3D")]
    
    [Parameter("Rigidbody")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenConditionQuaternion_Rigidbody_CheckRotation : Condition
    {
        [SerializeField] private GetGameObject m_Rigidbody = new GetGameObject(
            new GenTypeGameObject_Rigidbody()
        );
        
        [SerializeField] private GetQuaternion m_Value = new GetQuaternion();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Rotation");
            return $"{this.m_Rigidbody} {member} = {this.m_Value}";
        }
        
        protected override bool Run(Args args)
        {
            Rigidbody component = this.m_Rigidbody.Get<Rigidbody>(args);
            if (component == null) return false;
            
            return component.rotation == (Quaternion) this.m_Value.Get(args);
        }
    }
}


```

