From efec335aacb2f54b4251e3f11a05293425f7ef97 Mon Sep 17 00:00:00 2001 From: Yonatan Tussa <140031110+yonatantussa@users.noreply.github.com> Date: Wed, 25 Nov 2026 21:03:31 -0500 Subject: [PATCH] Fix passive viewer pause example --- doc/python.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/python.rst b/doc/python.rst index e3c9433a03..da779bf63a 100644 --- a/doc/python.rst +++ b/doc/python.rst @@ -232,7 +232,7 @@ Optionally, ``viewer.launch_passive`` accepts the following keyword arguments. def key_callback(keycode): if chr(keycode) == ' ': - nonlocal paused + global paused paused = not paused ... @@ -242,7 +242,7 @@ Optionally, ``viewer.launch_passive`` accepts the following keyword arguments. ... if not paused: mujoco.mj_step(m, d) - viewer.sync() + viewer.sync() ... - ``show_left_ui`` and ``show_right_ui``: Boolean arguments indicating whether UI panels should be visible