Jul 17, 2024
world.CSGBox node for the ground.CharacterBody3D node with a bean shape mesh and a simplified convex collision shape.WorldEnvironment and DirectionalLight to the scene tree for lighting.Node3D (pivot) to avoid janky rotations.speed, jump_velocity, and gravity.move_and_slide function to update character position based on velocity & collisions.Vector3 and multiply by character facing direction for movement._ready function.onready variables.unhandled_input to update camera rotation based on mouse movement.
y-axis for mouse X-movement.x-axis for mouse Y-movement.clamp function to limit camera rotation for a better experience._CSGBox nodes with different colors for a map.bob_frequency, bob_amplitude, and a variable to track progress along the sine wave.walk_speed and sprint_speed constants.lerp function to interpolate velocity, providing smoother transitions.base_fov, fov_change.lerp function to smoothly change FOV every physics tick.