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

# Collider Closest Point On Bounds

[Physics 3D](../index.md) / [Collider](index.md) / **Collider Closest Point On Bounds**

## Description

Compares the Closest Point On Bounds method of Collider component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Collider |  |
| Position |  |
| 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("Collider Closest Point On Bounds")]
    [Category("Physics 3D/Collider/Closest Point On Bounds")]
    [Description("Compares the Closest Point On Bounds method of Collider component to another value")]
    
    [Image(typeof(IconSphereSolid), ColorTheme.Type.Lime)]
    [Keywords("Physics, 3D")]
    
    [Parameter("Collider")]
    [Parameter("Position")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenConditionVector3_Collider_CheckClosestPointOnBounds_1 : Condition
    {
        [SerializeField] private GetGameObject m_Collider = new GetGameObject(
            new GenTypeGameObject_Collider()
        );
        
        [SerializeField] private GetVector3 m_Value = new GetVector3();
        
        [SerializeField] private GetVector3 m_Position = new GetVector3();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Closest Point On Bounds");
            string parameters = $"({this.m_Position})";
            return $"{this.m_Collider} {method} = {this.m_Value}";
        }
        
        protected override bool Run(Args args)
        {
            Collider component = this.m_Collider.Get<Collider>(args);
            if (component == null) return false;
            
            Vector3 value = component.ClosestPointOnBounds(
                (Vector3) this.m_Position.Get(args)
            );
            
            return value == (Vector3) this.m_Value.Get(args);
        }
    }
}


```

