浏览代码

Add missing if block to VR tutorial source example

Fixed formatting and corrected the example code to better reflect the intent of the tutorial text.
i.e.  "...The last thing we are doing in button_pressed is checking to see if the button pressed is 1..."
Kevin Abellan 7 年之前
父节点
当前提交
d60b05b480
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      tutorials/vr/vr_starter_tutorial.rst

+ 2 - 1
tutorials/vr/vr_starter_tutorial.rst

@@ -377,7 +377,8 @@ Add the following to ``VR_Controller.gd``:
         
         
         # If the menu button is pressed...
-        if grab_mode == "AREA":
+	if button_index == 1:
+		if grab_mode == "AREA":
 			grab_mode = "RAYCAST"
 			
 			if held_object == null: