"Your first 3D game" issues
There's a bunch of weird things I ran into while trying to follow the "Squash the Creeps" tutorial in Godot 4. I'm not a Godot expert and don't know how to fix some of these things, so I don't want to make a pull request, but I hope this list can help other contributors improve the documentation.
Common
The screenshots are inconsistent:
- some taken in Godot 3, some in Godot 4
- some use names in PascalCase, some in snake_case
- some nodes have the "3D" suffix (Godot 4), some don't (Godot 3), some have the lowercase "3d" suffix (beta1?)
- some screenshots are in PNG format, some are JPG, some are WebP (and I think WebP is worse than PNG), and they vary in quality and UI scale
Perhaps it would be a good idea to recreate all the screenshots after the first release candidate?
Your first 3D game
- [x] ~~
index.rst:34~~ (fixed in #6763) This link (https://github.com/GDQuest/godot-3d-dodge-the-creeps) redirects to https://github.com/godotengine/godot-3d-dodge-the-creeps — I think it would be nice to fix this unnecessary redirect. I also found this link in three other places:
Setting up the game area
-
[x] ~~
01.game_setup.rst:42~~ (fixed in #6763)click the Add Node button represented by a "+" icon
This button is actually "Add Child Node" even when there are no nodes in the scene
-
[x] ~~
01.game_setup.rst:43~~ (fixed in #6876)Name the node
Main.It seems this page doesn't explain how to rename nodes. Mentioning
RMB>RenameorF2would be good -
[x] ~~
01.game_setup.rst:48~~ (fixed in #7370)Save the scene as
Main.tscnGodot 4 suggests to name it
main.tscninstead. If I understand correctly, Godot 4 uses snake_case by default after https://github.com/godotengine/godot/pull/52597Same with other scenes (
MusicPlayer.tscn→music_player.tscnetc.)Note that if you decide to rename the scenes in this tutorial, you will have to rewrite all the text and recreate all the screenshots, because these names are visible almost everywhere.
-
[x] ~~
01.game_setup.rst:67~~ (fixed in #6763)Create a new Box Shape3D.
Unnecessary space: Box Shape3D → BoxShape3D
-
[x] ~~
01.game_setup.rst:89~~ (fixed in #6763)create a `BoxMesh <class_BoxMesh>` resourceBroken rst link?
-
[x] ~~
img/01.game_setup/13.move_gizmo_y_axis.png~~ (fixed in #6763)The
MeshInstance3Dis not rendered on this screenshot, which may confuse some users -
[x] ~~
01.game_setup.rst:131and01.game_setup.rst:135~~ (fixed in #6763)add a child node
DirectionalLightWe need to move and rotate theDirectionalLightnode.Renamed to
DirectionalLight3D
By the way: unlike Godot 3, the ground is not white in Godot 4. Can we tweak something to make the lighting identical to Godot 3?
Player scene and input actions
-
[ ]
02.player_input.rst:65and related screenshotimg/02.player_input/04.sphere_shape.pngThe sphere's wireframe appears below the character.
It doesn't appear in Godot 4 because it's too small by default and fits completely inside the model. I have to set the radius to 0.75 to see the wireframe
-
[x] ~~
02.player_input.rst:70~~ (Fixed in #9438)Shrink it a bit by dragging the orange dot in the viewport.
We should now enlarge it instead (from
0.5to0.8) -
[x] ~~
02.player_input.rst:106~~ (fixed in #10807) and related screenshotimg/02.player_input/07.input_map_tab.pngGodot projects come with some predefined actions
They are no longer visible by default, we need to click Show Built-in Actions to see them
-
[x] ~~
02.player_input.rst:130~~ (Fixed in #10807) and related screenshotsselect Manual Selection -> Joypad Axes.
The Manual Selection tab no longer exists, everything is in one window now
-
[x] ~~
02.player_input.rst:151~~ (Fixed in #10807)Bind the Space key and the gamepad's A button.
It's not obvious what is "the gamepad's A button", all gamepads are different. Maybe just mention "Joypad Button 0" instead?
Moving the player with code
-
[x] ~~
03.player_movement_code.rst:50~~ (fixed in #6763)The
velocityis a 3D vectorIt has been renamed to
target_velocityto prevent collision with the builtinvelocityproperty (the related code snippets are correct) -
[x] ~~
03.player_movement_code.rst:190~~if not is_on_floor(): # If in the air, fall towards the floor. Literally gravity target_velocity.y = target_velocity.y - (fall_acceleration * delta)This line is rendered with incorrect indentation because the rst source mixes tabs and spaces
-
[x] ~~
03.player_movement_code.rst:235~~ (fixed in #6763)Here is the complete
Player.gdcode for reference.- Inconsistent comment: "while in the air" / "when in the air"
- Incorrect 5-space indentation, starting from
if direction != Vector3.ZERO:
-
[ ]
img/03.player_movement_code/13.camera3d_values.webpThis screenshot doesn't highlight Projection: Orthogonal for some reason
Designing the mob scene
-
[x] ~~
04.mob_scene.rst:116~~ (fixed in #6763)func _physics_process(_delta): move_and_slide()Incorrect 5-space indentation
-
[x] ~~
04.mob_scene.rst:153~~ (fixed in #6763)Below,
rand_range()outputs a random valueRenamed to
randf_range() -
[x] ~~
04.mob_scene.rst:251~~ (fixed in #6763)Here is the complete
Mob.gdscript for reference.Again, incorrect 5-space indentation
Spawning monsters
-
[x] ~~
05.spawning_mobs.rst:14~~ (fixed in #6763)Our game has a default window size of
1024x600.I see
1152x648, I don't know why. Is this the new default value in Godot 4? -
We can update all four cylinders at once. Select all the mesh instances in the Scene dock.
This step is not needed because all cylinders share the same MeshInstance3D. Simply select any mesh instance
-
[x] ~~
05.spawning_mobs.rst:161~~ (fixed in #6811)Then, as we're going to spawn the monsters procedurally, we want to randomize numbers every time we play the game. If we don't do that, the monsters will always spawn following the same sequence.
It seems it's not needed, see https://github.com/godotengine/godot/pull/43330
Jumping and squashing monsters
-
[x] ~~
06.jump_and_squash.rst:239~~ (Fixed)With this code, if no collisions occurred on a given frame, the loop won't run.
Again, incorrect 5-space indentation
-
[x] ~~
06.jump_and_squash.rst:291~~ (fixed in #6763)collision.get_collider(index).is_in_group("mob")Typo,
indexis not needed here
Killing the player
-
[x] ~~
07.killing_player.rst:109~~ (fixed in #6763)var player_position = $Player.transform.originRenamed to
$Player.position, see05.spawning_mobs.rst:253 -
[x] ~~
07.killing_player.rst:272~~ (fixed in #6763)Incorrect 3-space indentation after
func squash(): -
[x] ~~
07.killing_player.rst:324~~ (fixed in #6763)The
extends CharacterBody3Dline fromPlayer.gdis not visible in html. I'm not a rst expert, but I guess there is a missing empty line before this line -
[x] ~~
07.killing_player.rst:332~~ (fixed in #6763)Missing comment
# Vertical impulse applied to the character upon jumping in meters per second. -
[ ]
07.killing_player.rst:346and related linesdirection.x = direction.x + 103.player_movement_code.rst:72suggests to usedirection.x += 1instead (same withz) -
[x] ~~
07.killing_player.rst:359~~ (fixed in #6763)$Pivot.look_at(position + direction,Vector3.UP)Missing space before
Vector3.UP -
[x] ~~
07.killing_player.rst:366~~ (fixed in #6763)if not is_on_floor(): # If in the air, fall towards the floorMissing
Literally gravitycomment, see03.player_movement_code.rst:189 -
func _on_mob_detector_body_entered(body):Line 12 (UNUSED_PARAMETER): The parameter 'body' is never used in the function '_on_mob_detector_body_entered'. If this is intended, prefix it with an underscore: '_body'
Score and replay
-
[x] ~~
08.score_and_replay.rst:68and08.score_and_replay.rst:76~~ (fixed in #6763)There, you will see an empty Font Data field. drag the
Montserrat-Medium.ttffile we included in the project onto the Font Data.Font Data has been renamed to Base Font (the related screenshots are correct)
-
[x] ~~
08.score_and_replay.rst:79~~ (fixed in #6763 and #6807)Set the Settings -> Size to
22pixelsIt has been renamed to Default Font Size (the related screenshot is correct)
-
[x] ~~
08.score_and_replay.rst:129~~ (fixed in #6807)Again, incorrect 5-space indentation
-
[x] ~~
08.score_and_replay.rst:176~~ (fixed in #7370)If you get an error when you squash a mob check your capital letters in the signal "_on_Mob_squashed"
Is this note still relevant? The only important thing is that
Main.gdandScoreLabel.gdmust use the same name. I tried renaming it to_dfg3f85f4fgbdfgand it works just fine. -
[x] ~~
08.score_and_replay.rst:203and related lines and screenshots~~ (fixed in #6763 and #6807)you can use the Layout menu in the toolbar.
It has been renamed to Anchor preset, the related screenshots need to be updated
-
[x] ~~
13.retry_color_picker.png~~ (fixed in #6807)This screenshot is outdated, the hex value has been changed from
78000000(ARGB) to00000078(RGBA) -
[x] ~~
08.score_and_replay.rst:270~~ (fixed in #6763)func _on_Player_hit():Renamed to
_on_player_hit, see07.killing_player.rst:134
Character animation
-
[x] ~~
09.adding_animations.rst:96~~ (Fixed in #8282) and related screenshotsMove the translation key to
0.2secondsAll the related screenshots show
0.3instead, which is incorrect -
[x] ~~
09.adding_animations.rst:185~~ (fixed in #7890 and #10829)If the creature is a little too close to the floor, you can move the
Pivotup to offset it.Not really. When I move
Pivotup, the player model starts looking at the ground becausePivotis rotated with$Pivot.look_at(position + direction, Vector3.UP). This will be fixed below by changing$Pivot.rotation.x, but at this point in the tutorial, movingPivotgives strange results. -
[x] ~~
09.adding_animations.rst:208~~ (fixed in #6763)$AnimationPlayer.playback_speed = 4It has been renamed to
speed_scalerecently: https://github.com/godotengine/godot/pull/71907 -
[X] ~~
09.adding_animations.rst:261~~ (Fixed in #8955)Next, click on Animation > Copy.
This menu doesn't exist in Godot 4. It seems we should use Animtion > Manage Animations, but I'm not sure.
-
[x] ~~
09.adding_animations.rst:262~~ (Fixed in #8955)That's it; all monsters will now play the float animation.
We also need to enable autoplay, which is disabled by default
-
[x] ~~
09.adding_animations.rst:274~~ (fixed in #6763)$AnimationPlayer.playback_speed = random_speed / min_speedAgain, renamed to
speed_scale -
[x] ~~
09.adding_animations.rst:296~~ (fixed in #6763)Again, the
extends CharacterBody3Dis not visible in html. In general, all these reference scripts also have the previously mentioned issues
P.S. I didn't test C#
I'll go over this on Friday and work on a PR for it. And keep in mind, even if you can't fix everything on this list there's nothing wrong with making a PR fixing only what you do know how to fix.
A comment on the C# part : to make things work, you will need to update some properties with the first letter changed to uppercase like below : direction.x += 1f; => direction.X += 1f;
Here I managed to use the Edit button on the top right to Copy Tracks and Paste Tracks. I had to use Animation > New for the Edit button to be available for pasting in the mob animation player.
Here I managed to use the
Editbutton on the top right toCopy TracksandPaste Tracks. I had to useAnimation > Newfor theEditbutton to be available for pasting in the mob animation player.
Also noticing it should mention:
- animation length needs to be adjusted to
1.2seconds - remember to enable
Autoplay on LoadandAnimation Looping
Thanks for making this list! I found another problem in "Setting up the game area" today: it says "hold the Ctrl key down to turn on grid snapping (Cmd on macOS)", but it's Ctrl on macOS as well.
Another one in "Designing the mob scene": "This function destroy the instance it's called on" should say "destroys". (oh and the method name in the code example directly below that is outdated)
Heyo! I actually have a fix/solution for one of the listed issues. I came across this exact issue when completing the tutorial. I apologize if this is completely out of etiquette or missing some kind of formatting. I'm very new to Godot, for reasons we all know I'm sure, and I'm fairly new to Git because again...Source Control features were handled in-engine in my previous experiences. Here's the issue I'm referring to:
==================================================== 09.adding_animations.rst:261
Next, click on Animation > Copy.
This menu doesn't exist in Godot 4. It seems we should use Animtion > Manage Animations, but I'm not sure.
====================================================
I digress! Point is, I'm fairly certain that I know how to solve this issue for the Character Animation section of this tutorial. I tried every, other way I could think of for a fix, but this method was the only one I had any success with in Godot 4.1. So, to get the animation to "Copy over," for use in the Mob class I had to:
- Select Player Scene
- Select Player Node
- Select the AnimationPlayer node in the Player node.
- With the Animation Panel open, Click on the Tool Button for "Animation"
- Choose Manage Animations
- Save the unsaved Global Library, which includes the developer created "float," animation within
- SIDE NOTE: I saved the Global Library as "AnimLib," to be a little more familiar with Unity's old school naming conventions
- Close the Edit Animation Libraries screen with the "OK" button
- Select/Open the Mob Scene
- Select the Mob Node
- Create a AnimationPlayer Child Node for Mob and Select it
- In the Animation Panel, again Click on the Tool Button for "Animation"
- Choose Manage Animations
- This time, Load Library and choose the "AnimLib," library which should be available along with the dev created "float," animation.
- The last step of, "make sure that the button with an "A+" icon (Autoplay on Load) and the looping arrows (Animation looping) are also turned on in the animation editor" works perfectly fine as-is.
Again, I apologize if this is the wrong way to suggest a fix, like I say I'm pretty new to both of these communities, but I hope this helps nonetheless!
Linking a relevant issue for copying animation here for the sake of visibility: https://github.com/godotengine/godot/issues/60848
Additional issue on character animation: https://github.com/godotengine/godot-docs/blob/971c1f73e74b6c8c609977355e92857f46a3df0e/getting_started/first_3d_game/09.adding_animations.rst?plain=1#L278 I believe the intention isn't integer division, but instead float division
Setting up the game area
godotengine/godot-demo-projects#884 for Godot 4 has superceded godotengine/godot-3d-dodge-the-creeps (just opened godotengine/godot-3d-dodge-the-creeps#14 a few minutes ago).
We better also rewrite the tutorial to go off the godotengine/godot-demo-projects entry instead of the outdated and unmaintained repo.
Here I managed to use the
Editbutton on the top right toCopy TracksandPaste Tracks. I had to useAnimation > Newfor theEditbutton to be available for pasting in the mob animation player.Also noticing it should mention:
- animation length needs to be adjusted to
1.2seconds- remember to enable
Autoplay on LoadandAnimation Looping
Using Godot 4.2.1.stable
I ran into this issue and considered the "Manage Animations" option, but the "Edit -> Copy Tracks" seemed more straightforward and clear to me, noting that you still have to add the AnimationPlayer on the Mob scene, so that's the approach I took to make it through.
That said, I additionally encountered a couple other interesting problems I'm not seeing referenced (just on quick searching through GitLab issues). Both are related to the character animation section:
-
While the guide correctly states to get animation keyframes from the
Characternode, all the subsequent screenshots that show the animation panel havePlayershowing as the target node. This threw me off for a good 40 minutes until I came across a reddit answer highlighting that the rootPlayershouldn't be used for keyframes. The issue this causes is that the player character is animated and floating, but no longer moves to player input. -- A more detailed explanation of why this happens might be worth noting in a warning/note callout. I took a few updated screenshots and will push up a PR if I get a chance. -
The player shadow is rendered weird when actually running the game. I've adjusted some settings and it mostly works, but the best thing I did was to make the window size bigger. From searches it looks like Godot 4.x has some LOD rendering issues with shadows, so I'm assuming that this is related, but I'm not well-versed in game engines enough yet to know for sure.
I've updated the list with the fixes from #8955. I'll be working on a PR to fix the remaining ones. This will take several days.
I also noticed that the shortcut for "Duplicate" in the tutorial is just listed as shift+D - but on macOS it's actually CMD+D
I just finished the tutorial and noticed that the stable version is still lacking several improvements mentioned in this thread (including the "Copy Animations" part that seems to trip up a lot of people). Is it too early to push some of these updates to the stable release? (Also, thanks for all the work that went into this 🙏 )
They are marked for cherry picking but haven't been processed yet, they will in some sweep