Godot FPS Movement Tutorial - Wall Running
Summary
TLDRThis tutorial walks through the process of adding wall running to a character controller in Godot. It starts with setting up the project, importing necessary files, and configuring key bindings. The script demonstrates how to create a basic wall running mechanic where the character sticks to the wall when jumping and holding the move forward key. The video addresses reliability issues, using wall normals to improve wall contact, and introduces a timer to limit the wall running duration. The tutorial also covers transitioning from first-person to third-person for easier visualization, and offers a brief explanation of tweaking mechanics for more polished gameplay.
Takeaways
- 😀 Download the necessary files from GitHub (wall run starter GD and wall run starter t-SCM) and import them into your Godot project.
- 😀 Set the physics FPS in the project settings to 240 for more reliable physics behavior, though this is optional.
- 😀 Ensure that input actions for moving forward and jumping are mapped in the project settings before proceeding with wall running mechanics.
- 😀 To implement wall running, create a new function `wall_run` in the character's script, with conditions for jumping and moving forward while touching a wall.
- 😀 Use collision information and the 'is on wall' condition to control the character's gravity and ensure proper wall running mechanics.
- 😀 Apply the normal of the wall collision to push the character up against the wall, ensuring reliable wall contact.
- 😀 Adjust the direction and strength of the applied force by calculating the opposite of the wall's normal vector.
- 😀 Fix issues with the wall run initiation by adding a small delay using a timer, allowing the character to jump before sticking to the wall.
- 😀 Introduce a timer to limit the duration of the wall run (e.g., 2.5 seconds), ensuring the character cannot wall run indefinitely.
- 😀 Add a condition to enable or disable the wall running based on whether the character is on the floor or mid-air, using a `w_runnable` variable.
- 😀 To revert to first-person view after testing, simply adjust the camera node's z-axis translation in the transform properties.
Q & A
What is the first step to enable wall running in Godot as per the tutorial?
-The first step is to download the two files, 'wall run starter GD' and 'wall run starter t-- SCM', from the GitHub repository, and load them into your Godot project.
Why is it recommended to set the physics FPS to 240?
-It is recommended to set the physics FPS to 240 to ensure the character's physics behave more consistently with the tutorial, as the default setting of 60 may cause differences in how the character moves or interacts with physics.
What input bindings are essential for this wall running script to work?
-The essential input bindings are 'move forward' and 'jump'. These are required to allow the character to move and trigger wall running.
How does the wall run function activate according to the script?
-The wall run function activates if the player holds down the 'jump' key, the 'move forward' key, and the character is in contact with a wall.
Why does the character sometimes fall off the wall during wall running?
-The character can fall off the wall if the angle of the wall is not right, causing the character to lose contact with the wall. This can be fixed by applying additional force to keep the character pressed against the wall.
What is the purpose of using the wall normal in the script?
-The wall normal is used to apply a force that pushes the character up against the wall, maintaining contact with it, regardless of the angle of the character's collision with the wall.
How does the script handle situations where the character is already close to the wall?
-To address the issue of the character running too close to the ground, the script introduces a small delay (0.2 seconds) using a timer to allow the character to jump before initiating the wall run.
What does the 'yield' statement in the script do?
-The 'yield' statement is used to create a delay, allowing the game to wait for 0.2 seconds before initiating the wall run script. This gives the character time to jump if they are already next to the wall.
How does the script limit the time a character can wall run?
-A timer node is added to the character. The timer is set to a specific wait time (e.g., 2.5 seconds) and starts when the character begins wall running. Once the timer expires, the wall run ability is disabled.
What change is made to revert the character to first-person mode?
-To revert the character to first-person mode, the script changes the camera node's z-axis translation back to 0, which restores the first-person perspective.
Outlines

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowMindmap

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowKeywords

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowHighlights

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowTranscripts

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowBrowse More Related Video

2D Top Down игра на Unity с нуля #5 | Анимация главного героя

Make a Basic Top Down Character // E01 // Make a 2D Action & Adventure RPG in Godot 4

Start Your Game Creation Journey Today! (Godot beginner tutorial)

SIMPLE 3rd Person Character Controller Godot 4 Tutorial

AACC - Spring 2023 - CTS-233-400 - DEVASC 200-901: Packet Tracer 8.8.2 Compare CLI & SDN Management

Godot 4 Settings Menu Tutorial
5.0 / 5 (0 votes)