Overview
In this episode, you'll implement two fundamental shooting mechanics: hitscan (instant raycast hits) and projectile (physics-based bullets). By the end, your weapon will fire either instant-hit shots or visible projectiles, both with visual feedback.
This episode builds directly on Episode 7 ( • Weapon State Machine - Godot FPS Series #7 ) state machine. We're adding actual shooting logic to replace the print statement.
What You'll Learn:
Raycast-based hitscan shooting
Physics-based projectile system
Toggling between shooting modes
Basic impact visualization
Prerequisites:
Completed Episode 7 (Weapon State Machine)
Understanding of Godot's raycast system
Basic 3D math (vectors, directions)
-----------------------------------------------------------------------------------
✅ GET THE SOURCE FILES
/ 146194976
✅ GET THE STARTERKIT PROJECT
/ make-fps-2-0-134340702
🏆 The FPS Tutorial Series 2.0 Roadmap
https://www.stayathomedev.com/blog/fp...
🎮 Wishlist My FPS Game, Children of Kronos
https://store.steampowered.com/app/36...
-----------------------------------------------------------------------------------
CHAPTERS
00:00 Hitscan vs. Projectile
00:10 Weapon Resource Script Changes
01:42 Adding Hitscan Firing
02:24 _perform_hitscan()
02:51 Using PhysicsRayQueryParameters3D
04:27 Spawning the Visual Impact Marker
05:10 Testing Hitscan
05:45 Selecting Collision Masks
06:29 Projectile Class Script
06:58 Why Not RigidBody3D?
09:21 Projectile Scene
10:15 Adding Projectile to Weapon Resource
11:00 Spawning Projectile
12:36 Projectile Test
12:56 Fixing Projectile Rotation
13:34 Better Collision Detection
14:58 Final Projectile Test
15:30 Get the Source Files
-----------------------------------------------------------------------------------
STAYATHOMEDEV ►► https://stayathomedev.com
TWITTER ►► / stayathomedev
BLUESKY ►► https://bsky.app/profile/stayathomede...
MY ITCH.IO PAGE ►► https://stayathomedev.itch.io/
PATREON ►► / stayathomedev_
-----------------------------------------------------------------------------------
Resources:
GODOT ENGINE ►► https://godotengine.org/
DOWNLOAD GODOT ►► https://godotengine.org/download
#godot #gamedev #fpstutorial