> For the complete documentation index, see [llms.txt](https://vc-docs.gitbook.io/engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vc-docs.gitbook.io/engine/home/doxygen_synced/files/_player_input_8cs.md).

# Source/PlayerInput.cs

## Classes

|       | Name                                                                                                                                                                                                                                                                                                                                                                                              |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| class | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/blob/main/Files/Classes/class_player.md"><strong>Player</strong></a><br>Legacy player API class retained for backward compatibility. Most members of this class are deprecated and will be removed in a future version. Use <a href="/pages/SHHaBKrdyJoK6wGmWb0O">PlayerInput</a> for all new player control functionality.</p> |
| class | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/blob/main/Files/Classes/class_player_input.md"><strong>PlayerInput</strong></a><br>Exposes player input state and control methods to the JavaScript API layer. Provides access to the current input platform, virtual axis sensitivities, the player transform, and methods to enable or disable player control.</p>            |
| class | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/blob/main/Files/Classes/class_player_input_1_1_current_platform.md"><strong>PlayerInput::CurrentPlatform</strong></a><br>Defines constants for the supported input platform types.</p>                                                                                                                                          |

## Source code

```csharp

public class Player
{
  public static void DisableControl()
  {
    RuntimeConsoleLogger.LogError("Function has been deprecated and will be removed in the future, Please use PlayerInput.DisablePlayer()");
  }

  public static void EnableControl()
  {
    RuntimeConsoleLogger.LogError("Function has been deprecated and will be removed in the future, Please use PlayerInput.EnablePlayer()");
  }

  public static void SetMoveSpeed(float ms)
  {
    RuntimeConsoleLogger.LogError("Function has been deprecated and will be removed in the future.");
  }

  public static void SetSensitivity(float s)
  {
    RuntimeConsoleLogger.LogError("Function has been deprecated and will be removed in the future.");
  }

  public static void SetFlatY(bool b)
  {
    RuntimeConsoleLogger.LogError("Function has been deprecated and will be removed in the future.");
  }

  public static void DisableServerEscape()
  {
    RuntimeConsoleLogger.LogError("Function has been deprecated and will be removed in the future.");
  }

  public static void EnableServerEscape()
  {
    RuntimeConsoleLogger.LogError("Function has been deprecated and will be removed in the future.");
  }

  public static string GetUserID()
  {
    return CurrentUser.GetInstance().GetUserID();
  }

  public static GameObject GetPlayer()
  {
    RuntimeConsoleLogger.LogError("Function has been deprecated and will be removed in the future. Please use PlayerInput.player");
    return null;
  }
}

public static class PlayerInput
{
  public static class CurrentPlatform
  {
    public static Platform MouseKeyboard => Platform.MouseKeyboard;

    public static Platform TouchScreen => Platform.TouchScreen;
  }

  public static Platform currentPlatform => ApplicationSettings.platform;

  public static float moveHorizontalAxis => playerController.controller.strafeAxis.sensitivity;

  public static float moveVerticalAxis => playerController.controller.moveAxis.sensitivity;

  public static float rotateHorizontalAxis => playerController.controller.rotateHorizontalAxis.sensitivity;

  public static float rotateVerticalAxis => playerController.controller.rotateVerticalAxis.sensitivity;

  public static Transform playerTransform => playerController.player;

  public static GameObject player => playerController.player.gameObject;

  public static void EnablePlayer()
  {
    playerController.StartPlayerControl();
  }

  public static void DisablePlayer()
  {
    playerController.StopPlayerControl();
  }
  static PlayerController playerController => NetworkClient.localPlayer.GetComponent<PlayerController>();
}
```

***

Updated on 2026-06-23 at 10:43:25 +0800
