I just wanted to make the FPS first person camera with Mouse Look, so I did exact followed this Youtuber’s instructions, but the Godot 4.2 vers alarmed me that some red bar is incorrect. That’s Youtuber’s version has 4.1.1 stable.
elif Input.is_action_pressed(“crouch”) or top_cast.is_colliding():
move_speed = crouch_speed
Godot Engine v4.1.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
modules/gltf/register_types.cpp:73 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started ---
res://Script/PlayerwithMouseFreeLook.gd:28 - Parse Error: Identifier "top_cast" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:29 - Parse Error: Identifier "move_speed" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:29 - Parse Error: Identifier "crouch_speed" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:55 - Parse Error: Identifier "head" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:56 - Parse Error: Identifier "rotation_degree" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:71 - Parse Error: Identifier "crouch_height" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:73 - Parse Error: Identifier "collision_shape" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:74 - Parse Error: Identifier "collision_shape" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:75 - Parse Error: Identifier "head" not declared in the current scope.
res://Script/PlayerwithMouseFreeLook.gd:75 - Parse Error: Identifier "head" not declared in the current scope.
modules/navigation/nav_region.cpp:126 - Navigation map synchronization error. Attempted to update a navigation region transform rotated 90 degrees or more away from the current navigation map UP orientation.
You can find the code you missed at the GitHub link below. (Which I found in the description of the YouTube video you linked to.) Note that the tutorial code has more var lines in the beginning than yours does. Those lines are important! They tell Godot about all the different variables you’re going to be using in the rest of the script. If you leave them out, then you can get errors like the ones you got here.
Didn’t see that in their description. However, when I did copy from the GitHub link and pasted into Gscript, it still same result… Here are the errors.
E 0:00:01:0436 PlayerwithMouseFreeLook.gd:14 @ _ready(): Node not found: “Head” (relative to “/root/Spatial/Player”).
<C++ Error> Method/function failed. Returning: nullptr
<C++ Source> scene/main/node.cpp:1638 @ get_node()
PlayerwithMouseFreeLook.gd:14 @ _ready()
Make sure to follow every step of the tutorial fully. This error is because you haven’t set everything up in the editor’s scene view for your player node yet. You’re going to be adding child nodes to the player that help define its behavior.
After a long 7 minutes of video, I can see what you mean. I’ve finally received the Mouse Look, however, with crouching my player goes through the floor. I’ve looked back at the Gscript and when I move my mouse, it’s rotating my player around the big capsule.
I also wanted my player to crouch for T-bag the enemy or crawl under the obstacle like Nagi has, however, I’ve slowly followed his instruction.