> For the complete documentation index, see [llms.txt](https://fast-studios.gitbook.io/press-e/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fast-studios.gitbook.io/press-e/manual/scripting/interactable/interactable.addconditionconst.md).

# Interactable.AddConditionConst

<mark style="color:blue;">public void</mark> <mark style="color:yellow;">AddConditionConst</mark>(\
&#x20;    <mark style="color:$success;">Component</mark> <mark style="color:$primary;">leftComponent</mark>, \
&#x20;    <mark style="color:blue;">string</mark> <mark style="color:$primary;">leftMember</mark>, \
&#x20;    <mark style="color:$success;">ConditionOperator</mark> <mark style="color:$primary;">op</mark>, \
&#x20;    <mark style="color:blue;">object</mark> <mark style="color:$primary;">constantValue</mark>, \
&#x20;    <mark style="color:$success;">LogicalJoin</mark> <mark style="color:$primary;">joinWithPrevious</mark> = <mark style="color:$success;">LogicalJoin</mark>.<mark style="color:$primary;">And</mark>)

<mark style="color:blue;">public void</mark> <mark style="color:yellow;">AddConditionConst</mark>(\
&#x20;    <mark style="color:$success;">GameObject</mark> <mark style="color:$primary;">leftTarget</mark>,\
&#x20;    <mark style="color:$success;">Type</mark> <mark style="color:$primary;">leftComponentType</mark>,\
&#x20;    <mark style="color:blue;">string</mark> <mark style="color:$primary;">leftMember</mark>,\
&#x20;    <mark style="color:$success;">ConditionOperator</mark> <mark style="color:$primary;">op</mark>,\
&#x20;    <mark style="color:blue;">object</mark> <mark style="color:$primary;">constantValue</mark>,\
&#x20;    <mark style="color:$success;">LogicalJoin</mark> <mark style="color:$primary;">joinWithPrevious</mark> = <mark style="color:$success;">LogicalJoin</mark>.<mark style="color:$primary;">And</mark>)

Adds a **condition with a constant value** to this Interactable’s Conditions list.\
There are two overloads: pass either the **component** directly, or a **GameObject + component type** (the system will get the gameobject from the component).

{% hint style="info" %}
**Note:** From the **second condition on the list**, `joinWithPrevious` becomes relevant (`And` / `Or`).\
First condition doesn’t need a join; Condition **#2** and later do.
{% endhint %}

```csharp
public Interactable interactable;

public void AddCondition()
{
    TestCondition testCondition = this.gameObject.GetComponent<TestCondition>()
    
    // Passing the component directly (GameObject auto-resolved):
    interactable.AddConditionConst(
        testCondition,
        nameof(testCondition.myFloatVar), // you can also pass "myFloatVar"
        ConditionOperator.Equal,          // check which vars support which ops
        10);
    
    // From the second condition on, specify the LogicalJoin when needed:
    interactable.AddConditionConst(
        testCondition,
        nameof(testCondition.myFloatVar), // you can also pass "myFloatVar"
        ConditionOperator.Equal,          // check which vars support which ops
        LogicalJoin.Or);
        
    // Using the GameObject + Type overload:
    interactable.AddConditionConst(
        gameObject,
        typeof(TestCondition),
        "myFloatVar",
        ConditionOperator.Equal,
        10);
}
```
