diff --git a/getting_started/first_3d_game/05.spawning_mobs.rst b/getting_started/first_3d_game/05.spawning_mobs.rst index 6b75f07a3..ca598b07d 100644 --- a/getting_started/first_3d_game/05.spawning_mobs.rst +++ b/getting_started/first_3d_game/05.spawning_mobs.rst @@ -269,6 +269,20 @@ what the *PathFollow* node's ``progress_ratio`` expects: The path we have set is around the camera's viewport, so any random value between 0 and 1 is a random position alongside the edges of the viewport! +Note that if you remove the ``Player`` from the main scene, the following line + +.. tabs:: + .. code-tab:: gdscript GDScript + + var player_position = $Player.position + + .. code-tab:: csharp + + Vector3 playerPosition = GetNode("Player").Position; + + +gives an error because there is no $Player! + Here is the complete ``main.gd`` script so far, for reference. .. tabs:: diff --git a/getting_started/first_3d_game/07.killing_player.rst b/getting_started/first_3d_game/07.killing_player.rst index 1210a47cc..a5ba331da 100644 --- a/getting_started/first_3d_game/07.killing_player.rst +++ b/getting_started/first_3d_game/07.killing_player.rst @@ -100,25 +100,6 @@ a ``die()`` function that helps us put a descriptive label on the code. Die(); } -Try the game again by pressing :kbd:`F5`. If everything is set up correctly, -the character should die when an enemy runs into the collider. Note that without a ``Player``, the following line - -.. tabs:: - .. code-tab:: gdscript GDScript - - var player_position = $Player.position - - .. code-tab:: csharp - - Vector3 playerPosition = GetNode("Player").Position; - - -gives an error because there is no $Player! - -Also note that the enemy colliding with the player and dying depends on the size and position of the -``Player`` and the ``Mob``\ 's collision shapes. You may need to move them -and resize them to achieve a tight game feel. - Ending the game --------------- @@ -153,6 +134,10 @@ and the remaining ones will leave the screen. Notice also that the game no longer crashes or displays an error when the player dies. Because we are stopping the MobTimer, it no longer triggers the ``_on_mob_timer_timeout()`` function. +Also note that the enemy colliding with the player and dying depends on the size and position of the +``Player`` and the ``Mob``\ 's collision shapes. You may need to move them +and resize them to achieve a tight game feel. + You can pat yourself in the back: you prototyped a complete 3D game, even if it's still a bit rough. diff --git a/getting_started/first_3d_game/09.adding_animations.rst b/getting_started/first_3d_game/09.adding_animations.rst index d99deefed..54e4d0125 100644 --- a/getting_started/first_3d_game/09.adding_animations.rst +++ b/getting_started/first_3d_game/09.adding_animations.rst @@ -43,7 +43,7 @@ time in seconds. We want the animation to start playback automatically at the start of the game. Also, it should loop. -To do so, you can click the button with an "A>" icon in the animation toolbar +To do so, you can click the autoplay button (|Autoplay|) in the animation toolbar and the looping arrows, respectively. |image5| @@ -271,7 +271,7 @@ should see the message "Global library will be created." Leave the text field bl click OK. Click the *Paste* icon (clipboard) and it should appear in the window. Click OK to close the window. -Next, make sure that the button with an "A>" icon (Autoplay on Load) and the looping +Next, make sure that the autoplay button (|Autoplay|) and the looping arrows (Animation looping) are also turned on in the animation editor in the bottom panel. That's it; all monsters will now play the float animation. @@ -639,3 +639,4 @@ And the *Mob*'s script. .. |animation_final_keyframes| image:: img/09.adding_animations/animation_final_keyframes.webp .. |second_keys_both| image:: img/09.adding_animations/second_keys_both.webp .. |timeline_05_click| image:: img/09.adding_animations/timeline_05_click.webp +.. |Autoplay| image:: img/09.adding_animations/ diff --git a/getting_started/first_3d_game/img/02.player_input/left_inputmap.webp b/getting_started/first_3d_game/img/02.player_input/left_inputmap.webp index dbad98201..e66d74c2a 100644 Binary files a/getting_started/first_3d_game/img/02.player_input/left_inputmap.webp and b/getting_started/first_3d_game/img/02.player_input/left_inputmap.webp differ diff --git a/getting_started/first_3d_game/img/09.adding_animations/autoplay_button.webp b/getting_started/first_3d_game/img/09.adding_animations/autoplay_button.webp new file mode 100644 index 000000000..06b4bffb1 Binary files /dev/null and b/getting_started/first_3d_game/img/09.adding_animations/autoplay_button.webp differ