---
tags:
    - "Input, Player, Controls, Local, Multiplayer, Co-op"
---

# Player Input Switch Current Action Map

[Input](../index.md) / [Player Input](index.md) / **Player Input Switch Current Action Map**

## Description

Executes the Switch Current Action Map method on the Player Input component

## Parameters

| Name | Description |
| :--- | :---------- |
| Map Name Or Id |  |

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

namespace VisualScript.Runtime
{
    [Title("Player Input Switch Current Action Map")]
    [Category("Input/Player Input/Switch Current Action Map")]
    [Description("Executes the Switch Current Action Map method on the Player Input component")]

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

    [Parameter("Map Name Or Id")]

    [Serializable]
    public class GenInstructionPlayerInput_SwitchCurrentActionMap_1 : Instruction
    {
        [SerializeField] private GetGameObject m_PlayerInput = new GetGameObject(
            new GenTypeGameObject_PlayerInput()
        );

        [SerializeField] private GetString m_MapNameOrId = new GetString();

        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Switch Current Action Map");
            return $"{this.m_PlayerInput} {method} ({this.m_MapNameOrId})";
        }

        protected override Awaitable Run(Args args)
        {
            PlayerInput component = this.m_PlayerInput.Get<PlayerInput>(args);
            if (component == null) return Done;

            component.SwitchCurrentActionMap(
                (string) this.m_MapNameOrId.Get(args)
            );

            return Done;
        }
    }
}
```

