Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Trail Renderer Position Count#

Effects / Trail Renderer / Trail Renderer Position Count

  • Can Read

  • Cannot Write

Description#

The Position Count property of the Trail Renderer component

Code#

// <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
{
    [Get]
    
    [Title("Trail Renderer Position Count")]
    [Category("Effects/Trail Renderer/Position Count")]
    [Description("The Position Count property of the Trail Renderer component")]
    
    [Image(typeof(IconTrailRenderer), ColorTheme.Type.Blue, typeof(BadgeEye))]
    [Keywords("Effect")]
    
    [Serializable]
    public class GenTypeInteger_TrailRenderer_PositionCount : TypeNumber
    {
        [SerializeField] private GetGameObject m_TrailRenderer = new GetGameObject(
            new GenTypeGameObject_TrailRenderer()
        );
        
        public override double GetPreview(GameObject source)
        {
            GameObject instance = this.m_TrailRenderer.GetPreview(source);
            if (instance == null) return default;
            
            TrailRenderer component = instance.GetComponent<TrailRenderer>();
            return component != null ? component.positionCount : default;
        }
        
        public override double Get(Args args)
        {
            TrailRenderer instance = this.m_TrailRenderer.Get<TrailRenderer>(args);
            return instance != null
                ? instance.positionCount
                : default;
        }
        
        public override string ToString()
        {
            return $"{this.m_TrailRenderer} Position Count";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.