---
tags:
    - "Physics, 2D"
---

# Constant Force 2D Relative Force

[Physics 2D](../../index.md) / [Effectors](../index.md) / [Constant Force 2D](index.md) / **Constant Force 2D Relative Force**

## Description

Compares the Relative Force property of Constant Force 2D component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Constant Force 2D |  |
| 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("Constant Force 2D Relative Force")]
    [Category("Physics 2D/Effectors/Constant Force 2D/Relative Force")]
    [Description("Compares the Relative Force property of Constant Force 2D component to another value")]
    
    [Image(typeof(IconWeight), ColorTheme.Type.Lime, typeof(Badge2D))]
    [Keywords("Physics, 2D")]
    
    [Parameter("Constant Force 2D")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenConditionVector2_ConstantForce2D_CheckRelativeForce : Condition
    {
        [SerializeField] private GetGameObject m_ConstantForce2D = new GetGameObject(
            new GenTypeGameObject_ConstantForce2D()
        );
        
        [SerializeField] private GetVector2 m_Value = new GetVector2();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Relative Force");
            return $"{this.m_ConstantForce2D} {member} = {this.m_Value}";
        }
        
        protected override bool Run(Args args)
        {
            ConstantForce2D component = this.m_ConstantForce2D.Get<ConstantForce2D>(args);
            if (component == null) return false;
            
            return component.relativeForce == (Vector2) this.m_Value.Get(args);
        }
    }
}


```

