Create Your First Complete 3D Game with Godot

preview_player
Показать описание

In this final lesson in the course, you'll code a 3D game from start to finish in Godot. You'll learn to spawn random monsters, jump and squash mechanics, animation, and more.

---
00:00:00 Introduction
00:01:13 Downloading and importing the starter project
00:02:16 Creating the floor and light
00:06:32 Creating the player scene
00:09:17 Coding player movement
00:18:01 Setting up the camera
00:21:45 Making the player face the movement direction
00:23:25 Making the character jump
00:27:01 Creating the monster scene
00:29:50 Making the monster move
00:34:52 Spawning monsters randomly
00:46:38 Updating the collision layers
00:50:41 Coding the squash mechanic
00:57:41 Killing the player
01:02:07 Counting and displaying the score
01:09:15 Designing the try again screen
01:13:06 Adding player animations
01:26:07 Adding enemy animations
01:28:43 Adding music
01:29:17 Improving the shadow colors

---
📚 THE LINKS

---
💌 JOIN US

---
📝 CC-BY LICENSE

Рекомендации по теме
Комментарии
Автор

Going through this great tutorial in a newer version of Godot (4.2.1 Stable), I found a lot of things that have changed between versions which make it hard to follow for new users. Here is my list. organized in chronological order of video appearance:

- "KinematicBody" node is now "CharacterBody3D"
- "Spatial" node is now "Node3D"
- Many other nodes now have a "3D" suffix, but are otherwise the same
- "VisibilityNotifier" node is now "VisibleOnScreenNotifier3D"
- velocity is a default variable now and cannot be declared as a new variable in our code. we also do not need to set it = Vector3.ZERO at the top of our code, as that should be it's default value and it does not want to be set outside a function or loop for some reason...
- move_and_slide() does not need an argument anymore as it takes the current velocity to do its function
- "translation" has been renamed to "position"
- "rand" and "rand_range" are now "randf", "randf_range"
- on MeshInstance3D, "Material" tab is now "Surface Material Override"; "New SpatialMaterial" is now "New StandardMaterial3D"; if the color picker in the "Albedo" tab pop-up doesn't look like the video, click the small white button at the middle-right of the tab, "Select a picker shape" and click "HSV Rectangle"
- "PathFollow" node's "Unit Offset" is now "Progress Ratio"; remember to call the new name later in code instead of Unit Offset
- "instance()" is now "instatiate()"
- "get_slide_count()" is now
- in the Mob script, "collider" and "normal" are now "get_collider()" and "get_normal()"
- "Full Rect" setting in "Layout" is in a smaller button next to the View tab on the top toolbar and has the same icon in the video but without the text
- Fonts have been updated in Godot 4, so there's a few different ways of achieving the desired result here, but none match this video exactly. Here is what I did:
- Under your "New Theme" > "Default Font" dropdown, select "New FontVariation"; Then drag the .tff file onto the "Base Font" section and adjust the "Default Font Size" setting a few rows down
- For connecting the mob squashed signal and ScoreLabel method in the Main script, there are a variety of ways to achieve the desired result using Connect() (which is changed in Godot 4); I used the following, which requires changing the ScoreLabel node to a unique name by right-clicking > "Access as Unique Name" :
- mob.connect("squashed", Callable(%ScoreLabel, "on_mob_squashed"))
- For the animation script in Player, "playback_speed" is now "speed_scale"
- Scene merging wasn't an option for adding the "AnimationPlayer" from the Player to the Mob scene in my project, but you can still copy and paste a node from one scene to the other with the same effect.
- In the "WorldEnvironment" node's "Ambient Light" setting, you need to set "Source" to "Color"

Comment if i missed anything. Upvote if you find this helpful so new viewers will see it. I did still have one issue with mob spawning and player death that I couldn't solve. Something about using "var player_position = $Player.transform.origin" with the mob.initialize() function seems to make make Godot think the mobs occupy the origin, even if it's just for a fraction of a frame that doesn't render. Because if the player is on the origin when a mob spawns it dies. I debugged for a long time to figure out why I always died in that spot, but couldn't find a good, simple solution; so i decided to move on and post my notes.

jamespalermo
Автор

A moment to say how much I appreciate you adding a thumbnail to the game projects, makes it so much easier to find in the Project list. Details that matter.

salarycat
Автор

50:40 Just a quick note. If anyone is having issues with the mobs going through the floor as it collides with the player, you may want to turn on the mask in 'collision' for the 'Ground' to detect both the player and the enemies.

katesaychaleun
Автор

A small bug I noticed was that if the player was in the air when a mob spawned it would be "looking up" opposed to flat on the ground. I replaced the call to look_at in the tutorial with:
look_at(Vector3(player_position.x, 0.0, player_position.z), Vector3.UP)

Now my mobs spawn flat as they should. Hope this helps anyone that may run into this too.

erik-martin
Автор

A couple of personal notes. If you're making world a physics layer (which does make sense), I think it's likely better to make that the first layer, not the player. The reason being I assume most new objects will use the first layer by default. Most of the assets you will import and give physics will be environment stuff in most games, so you don't want to have to fiddle too much with them and have them work out of the box as much as possible. Meanwhile you'll usually have only one player, or maybe a handful. Same for enemies, you'll usually have a decent amount, but generally way less than world assets.

It seems the "gravity" code of the player was not moved to after the "bounce" check. This makes the gravity effect inconsistent on either jumps or bounce depending on the intended behaviour (and jump height inconsistent if non-programmer game designers were to play with the numbers). In this case I doubt the impact is anything to note, but this kind of discipline is very important to keep in mind for programming, especially game programming. This would have also been a good opportunity to present the use of function as not only blocks of reusable code, but sometimes a good way to keep your code tidy, understandable, and easy to rearrange. Having a "fall" "gravity" method here would have helped keeping in mind the expected order of physics processes.

Mind you, if you do read these, these are not really critics. The nature of the tutorial makes it impossible, especially in video format, to be perfect. These are notes, in case people do come here and find this comment. These may help them boost their coding knowledge if they're new.

DevilBlackDeath
Автор

It took me a while to figure this out, but when spawning mobs the position needs to be set before add_child, otherwise if the player is at 0, 0, 0 it will trigger a collision for the MobDetector. This is with Godot 4

Goalatio
Автор

Very nice starting point for 3D.
Also you covered a lot of important effects in a quick and simple way.

flafcodes
Автор

I needed a few days to follow the instructions in this video but every single step perfectly worked even in the latest Godot version. Thank you so much.

Netaction
Автор

For anybody whose player character won't move, make sure that you haven't accidentally detached the script. If the icon on the script is green then you've detached the script and need to attach it again.

keithprice
Автор

Never taught 3D was this simple. Im still not gonna underestimate it, but I will aim higher now! Thank you!

creationsmarko
Автор

Your tutorials are very clear and "fluid", thank you !

arthurbourdot
Автор

Great tutorial! But... There are so many things here that doesn't work anymore in Godot 4. Like I can't get the enemy hit detection to work... Could you please make a new version of this tutorial?

FifthOfNovember_Original
Автор

Now this is interesting. If anything, godot docs lacked 3d tutorial like this one. Thanks a lot!

nopens
Автор

Uploading more like these really help us to stay connected... It never feels like we are following something outdated. I used to hate Godot but these crystal clear videos proved me wrong. Thanks a lot

sreejithsree
Автор

At first, we dodged the creeps. Today, we get our revenge!

Braum_Stroomin
Автор

I've been very intimidated to make the jump from 2d to 3d, and this tutorial really helped me make that hurtle.

imacds
Автор

Great Tutorial thank you for keeping it free. Keep it up!

pri_yan_shu_raj
Автор

i followed every step but my player don't move ... im lost

alphu
Автор

EXCELLENT TUTORIAL! Appreciate you describing each step and the whole process. Much better than getting bits and pieces from many tutorials.

krasnavin
Автор

39:48 - dots do not snap, even in your video
they only snap if you move them after Closing Curve

Rustam