File tree Expand file tree Collapse file tree 5 files changed +21
-21
lines changed
getting_started/first_3d_game Expand file tree Collapse file tree 5 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,20 @@ what the *PathFollow* node's ``progress_ratio`` expects:
269269The path we have set is around the camera's viewport, so any random value between 0 and 1
270270is a random position alongside the edges of the viewport!
271271
272+ Note that if you remove the ``Player `` from the main scene, the following line
273+
274+ .. tabs ::
275+ .. code-tab :: gdscript GDScript
276+
277+ var player_position = $Player.position
278+
279+ .. code-tab :: csharp
280+
281+ Vector3 playerPosition = GetNode<Player>("Player").Position;
282+
283+
284+ gives an error because there is no $Player!
285+
272286Here is the complete ``main.gd `` script so far, for reference.
273287
274288.. tabs ::
Original file line number Diff line number Diff line change @@ -100,25 +100,6 @@ a ``die()`` function that helps us put a descriptive label on the code.
100100 Die();
101101 }
102102
103- Try the game again by pressing :kbd: `F5 `. If everything is set up correctly,
104- the character should die when an enemy runs into the collider. Note that without a ``Player ``, the following line
105-
106- .. tabs ::
107- .. code-tab :: gdscript GDScript
108-
109- var player_position = $Player.position
110-
111- .. code-tab :: csharp
112-
113- Vector3 playerPosition = GetNode<Player>("Player").Position;
114-
115-
116- gives an error because there is no $Player!
117-
118- Also note that the enemy colliding with the player and dying depends on the size and position of the
119- ``Player `` and the ``Mob ``\ 's collision shapes. You may need to move them
120- and resize them to achieve a tight game feel.
121-
122103Ending the game
123104---------------
124105
@@ -153,6 +134,10 @@ and the remaining ones will leave the screen.
153134Notice also that the game no longer crashes or displays an error when the player dies. Because
154135we are stopping the MobTimer, it no longer triggers the ``_on_mob_timer_timeout() `` function.
155136
137+ Also note that the enemy colliding with the player and dying depends on the size and position of the
138+ ``Player `` and the ``Mob ``\ 's collision shapes. You may need to move them
139+ and resize them to achieve a tight game feel.
140+
156141You can pat yourself in the back: you prototyped a complete 3D game,
157142even if it's still a bit rough.
158143
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ time in seconds.
4343We want the animation to start playback automatically at the start of the game.
4444Also, it should loop.
4545
46- To do so, you can click the button with an "A>" icon in the animation toolbar
46+ To do so, you can click the autoplay button (| Autoplay |) in the animation toolbar
4747and the looping arrows, respectively.
4848
4949|image5 |
@@ -271,7 +271,7 @@ should see the message "Global library will be created." Leave the text field bl
271271click OK. Click the *Paste * icon (clipboard) and it should appear in the window. Click OK
272272to close the window.
273273
274- Next, make sure that the button with an "A>" icon ( Autoplay on Load ) and the looping
274+ Next, make sure that the autoplay button (| Autoplay | ) and the looping
275275arrows (Animation looping) are also turned on in the animation editor in the bottom panel.
276276That's it; all monsters will now play the float animation.
277277
@@ -639,3 +639,4 @@ And the *Mob*'s script.
639639.. |animation_final_keyframes | image :: img/09.adding_animations/animation_final_keyframes.webp
640640.. |second_keys_both | image :: img/09.adding_animations/second_keys_both.webp
641641.. |timeline_05_click | image :: img/09.adding_animations/timeline_05_click.webp
642+ .. |Autoplay | image :: img/09.adding_animations/
You can’t perform that action at this time.
0 commit comments