---
tags:
    - "Effect"
---

# Line Renderer Set Position

[Effects](../index.md) / [Line Renderer](index.md) / **Line Renderer Set Position**

## Description

Executes the Set Position method on the Line Renderer component

## Parameters

| Name | Description |
| :--- | :---------- |
| Index |  |
| Position |  |

## 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("Line Renderer Set Position")]
    [Category("Effects/Line Renderer/Set Position")]
    [Description("Executes the Set Position method on the Line Renderer component")]
    
    [Image(typeof(IconLineRenderer), ColorTheme.Type.Blue, typeof(BadgeEye))]
    [Keywords("Effect")]
    
    [Parameter("Index")]
    [Parameter("Position")]
    
    [Serializable]
    public class GenInstructionLineRenderer_SetPosition_2 : Instruction
    {
        [SerializeField] private GetGameObject m_LineRenderer = new GetGameObject(
            new GenTypeGameObject_LineRenderer()
        );
        
        [SerializeField] private GetInteger m_Index = new GetInteger();
        
        [SerializeField] private GetVector3 m_Position = new GetVector3();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Position");
            return $"{this.m_LineRenderer} {method} ({this.m_Index}, {this.m_Position})";
        }
        
        protected override Awaitable Run(Args args)
        {
            LineRenderer component = this.m_LineRenderer.Get<LineRenderer>(args);
            if (component == null) return Done;
            
            component.SetPosition(
                (int) this.m_Index.Get(args),
                (Vector3) this.m_Position.Get(args)
            );
            
            return Done;
        }
    }
}


```

