Enter Play Mode With F5 Key (in Unity)

Enter Play Mode With F5 Key (in Unity)

  • I would like to enter Play Mode with F5 key.
There is no one-key keyboard shortcut to enter Play Mode and you can not intercept built-in Unity keyboard shortcuts.
You can define your own keyboard shortcuts to do what you want. In the sample Editor script below, you can see how to detect the F5 key and enter Play Mode.
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine.SceneManagement;

public class EditorShortCutKeys : ScriptableObject {

    [MenuItem("Edit/Run _F5")] // shortcut key F5 to Play (and exit playmode also)
    static void PlayGame() {
        if (!Application.isPlaying) {
            EditorSceneManager.SaveScene(SceneManager.GetActiveScene(), "", false);


To enable this functionality, place this script into Editor folder and then press F5 to enter/exit Play Mode.


Was this article helpful?

Related Articles