godot-docs
godot-docs copied to clipboard
Your first 2D game - 4.0 readying
Your Godot version: 4.0
Issue description: There are a few places where things have changed in 4.x. I'm stuck on a few, but appear to be mostly easy fixes?
https://docs.godotengine.org/en/latest/getting_started/first_2d_game/04.creating_the_enemy.html Many node names have changed slightly.
https://docs.godotengine.org/en/latest/getting_started/first_2d_game/05.the_main_game_scene.html export doesn't work here either, this is where I got stuck
URL to the documentation page: https://docs.godotengine.org/en/latest/getting_started/first_2d_game/03.coding_the_player.html uses export, tried changing to @export but that didn't work
I found that changing export to @export worked - and I was able to see that variable in the Inspector. You're correct in that it should be shown with the preceding @ symbol in this guide/tutorial.
I'm using the 4.0 build from 20220118 on Windows 11 (64 bit)
Thanks, I think I must have not been inspecting the right thing. That first one works now. The last export I need to find new syntax I guess?
The last export I need to find new syntax I guess?
I think the format for the second export will be @export var mob_scene: PackedScene although I haven't actually tested that out myself yet. I'll have a go at it in the next few days and let you know if it works.
That worked with one other change: var mob = mob_scene.instantiate() #was instance
Also had to change some rand_range -> randi_range
There are a few renames needed for the 4.0 beta.
In section 5, "The main game scene":
I made an attempt at a fix, but I haven't tested the C# and C++ changes for origin -> progress_ratio. I'll try to verify those soon and update the PR if needed, but the guesses seem reasonable.
This is the last one remaining from making the tutorial code-compatible with 4.0 https://github.com/godotengine/godot-docs/issues/6234
This was fixed by multiple PRs, namely https://github.com/godotengine/godot-docs/pull/6275 (wasn't linked properly). If there are any missing renames or examples of outdated syntax, please open new issues.