Juiced Up First Person Character Controller Tutorial - Godot 3D FPS

LegionGames
19 May 202310:47

Summary

TLDRIn this tutorial, the creator guides viewers through building a first-person character controller from scratch, integrating features like head bobbing and field of view changes to enhance the game experience. Utilizing Godot's CSG box for prototyping, the character is set up with basic movement and jump functionality. The video delves into coding details, including handling gravity, jump mechanics, and movement direction. It also covers input mapping, camera rotation, and mouse sensitivity adjustments. Additional game juice is added with head bobbing effects using sine waves and sprinting mechanics, concluding with inertia and field of view adjustments for a more immersive gameplay.

Takeaways

  • ๐ŸŽฎ The video tutorial covers creating a first-person character controller from scratch with added 'game juice' features.
  • ๐Ÿ—๏ธ The process begins by setting up a new 3D scene and using a CSG box for ground prototyping and a character body mesh for the player.
  • ๐Ÿ‘พ A script is added to the character for basic movement and jumping, which works for both first and third-person perspectives.
  • ๐Ÿ’ก Lighting and a world environment are set up with a directional light to mimic the sun for a realistic look.
  • ๐Ÿ”’ The camera is added as a child of a node 3D to prevent 'janky' rotation issues, with a reference to Godot documentation for further details.
  • ๐Ÿ“ Constants for speed, jump velocity, and gravity are defined, with the physics process handling jumps and character movement.
  • ๐Ÿ•น๏ธ Custom input mapping is created to replace default UI actions, allowing for more personalized control settings.
  • ๐Ÿ” The tutorial discusses handling mouse input for camera rotation, with sensitivity adjustments and clamping to limit rotation range.
  • ๐Ÿƒโ€โ™‚๏ธ Head Bob effect is implemented using sine waves to simulate the character's footsteps, enhancing the game's immersion.
  • ๐Ÿ”„ Inertia is added to the character's movement to prevent abrupt stops in mid-air, providing a smoother player experience.
  • ๐Ÿ”ฌ The camera's field of view (FOV) changes dynamically based on the character's speed, adding another layer of realism to the gameplay.

Q & A

  • What is the main focus of the video?

    -The video focuses on creating a first-person character controller from scratch with various game feel enhancing features, also known as game juice.

  • What are some of the game feel features included in the character controller?

    -The game feel features include head Bob, inertia, movement, and field of view (FOV) change.

  • What is the purpose of using a CSG box for the ground in the 3D scene?

    -The CSG box is used for its simplicity and combination with a collision shape, which is good for prototyping.

  • Why is the character body using an old code character body 3D?

    -The old code character body 3D is used because it has a default code template with movement and jumps implemented, which works well for both first-person and third-person control.

  • How does the video handle the lighting in the game scene?

    -The video adds a world environment and a directional light to the scene tree to imitate the sun and ensure proper lighting.

  • What is the purpose of adding a camera as a child of a node 3D?

    -Adding a camera as a child of a node 3D acts as a pivot to avoid janky results when rotating the camera without one.

  • What is the issue with the default UI actions in the character controller code?

    -The default UI actions are replaced with custom ones to allow for more control over the character's movement and interactions.

  • How does the video address the problem of the character not moving in the direction it's facing?

    -The video suggests setting the direction of movement to where the head is facing instead of the character body, as the head is responsible for looking left and right.

  • What mathematical function is used to implement the head Bob feature?

    -The sine wave function is used to implement the head Bob feature, which moves the camera up and down to imitate footsteps.

  • How is the sprinting mechanic integrated into the character controller?

    -Sprinting is integrated by changing the character's speed variable based on whether the shift key is pressed, with separate constants for walk speed and sprint speed.

  • What is the purpose of the inertia in the character controller?

    -Inertia is added to give the player more control over horizontal movement in the air and to ensure a smoother transition when the player stops moving mid-air.

  • How does the video change the camera field of view based on character speed?

    -The video uses a formula that adds a base FOV and a FOV change multiplied by the character's velocity, clamping the velocity to ensure the FOV doesn't become too extreme.

Outlines

plate

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

Upgrade Now

Mindmap

plate

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

Upgrade Now

Keywords

plate

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

Upgrade Now

Highlights

plate

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

Upgrade Now

Transcripts

plate

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

Upgrade Now
Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
Game DevelopmentCharacter ControllerFirst-PersonGodot EngineGame JuiceHead BobInertiaMovementFOV ChangeTutorial