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

# Set Surface Effector 2D Use Friction

[Physics 2D](../../index.md) / [Effectors](../index.md) / [Surface Effector 2D](index.md) / **Set Surface Effector 2D Use Friction**

## Description

Sets the Use Friction property of Surface Effector 2D component

## Parameters

| Name | Description |
| :--- | :---------- |
| Surface Effector 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("Set Surface Effector 2D Use Friction")]
    [Category("Physics 2D/Effectors/Surface Effector 2D/Use Friction")]
    [Description("Sets the Use Friction property of Surface Effector 2D component")]
    
    [Image(typeof(IconSurfaceEffector), ColorTheme.Type.Lime, typeof(Badge2D))]
    [Keywords("Physics, 2D")]
    
    [Parameter("Surface Effector 2D")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenInstructionBool_SurfaceEffector2D_SetUseFriction : Instruction
    {
        [SerializeField] private GetGameObject m_SurfaceEffector2D = new GetGameObject(
            new GenTypeGameObject_SurfaceEffector2D()
        );
        
        [SerializeField] private GetBool m_Value = new GetBool();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Use Friction");
            return $"{this.m_SurfaceEffector2D} {member} = {this.m_Value}";
        }
        
        protected override Awaitable Run(Args args)
        {
            SurfaceEffector2D component = this.m_SurfaceEffector2D.Get<SurfaceEffector2D>(args);
            if (component == null) return Done;
            
            component.useFriction = (bool) this.m_Value.Get(args);
            
            return Done;
        }
    }
}


```

