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

Player Input On Device Lost#

Input / Player Input / Player Input On Device Lost

Description#

Executes whenever the On Device Lost event of Player Input component is invoked

Parameters#

Name Description
Source

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;
using UnityEngine.InputSystem;

namespace VisualScript.Runtime
{
    [Title("Player Input On Device Lost")]
    [Category("Input/Player Input/On Device Lost")]
    [Description("Executes whenever the On Device Lost event of Player Input component is invoked")]

    [Image(typeof(IconBoltOutline), ColorTheme.Type.Blue)]
    [Keywords("Input, Player, Controls, Local, Multiplayer, Co-op")]

    [Parameter("Source")]

    [Serializable]
    public class GenTriggerPlayerInput_OnDeviceLost : TriggerSourceComponentBase<PlayerInput>
    {

        public GenTriggerPlayerInput_OnDeviceLost() : base(new GenTypeGameObject_PlayerInput())
        { }

        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("On Device Lost");
            return $"{this.SourceName} {member}";
        }

        protected override void OnSourceChanged(PlayerInput previousSource, PlayerInput newSource)
        {
            if (previousSource != null)
            {
                previousSource.onDeviceLost -= this.Run;
            }

            if (newSource != null)
            {
                newSource.onDeviceLost += this.Run;
            }
        }

        private void Run(PlayerInput value1)
        {
            using Args args = Args.Get(
                this.Component,
                this.m_CurrentSource
            );

            this.Run(args);
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.