Ray-Cast Bullet Collision Detection for Godot 3D World!

Опубликовано: 07 Март 2024
на канале: Battery Acid Dev
1,027
38

This tutorial shows you how to detect bullet collision in a 3D multiplayer game using Godot's ray-cast functionality. We simulate bullet fire by using a ray cast to see if it collides with something in game. I show you how to lock down the collision detection to a specific layer to avoid unnecessary detections. I also cover how to visually debug the ray casts during game play!

I'm going to add to the series by introducing 3rd person aim tracking with arm animation, weapon attachment to hand, gun animations, and whatever else you guys ask for!

[Looking for the code?]
👉   / batteryaciddev  

Starter project:
https://www.patreon.com/posts/godot-4...


[DOCS]
https://docs.godotengine.org/en/stabl...


👋 Let's talk shop 👇
[Helpful Unity Networking Assets] https://prf.hn/l/n0bZqOe
[Discord]   / discord  
[Twitter]   / batteryaciddev  
[Support the channel] https://www.getyourgamedone.com/chann...



00:00:00 INTRO
00:00:21 PICKUP BASE PROJECT
00:00:38 MOUSE CLICK KEY BINDING
00:01:08 MOUSE CLICK LISTENER
00:01:35 RAYCAST INPUTS
00:03:51 GUNFIRE NODE AND SCRIPT
00:08:38 MOB COLLISION LAYER
00:10:29 KILL MOB FUNCTION
00:12:28 ANIMATIONS REFACTOR
00:13:16 DEAD VARIABLE USE
00:14:23 SETUP DEATH ANIMATION
00:15:43 ADD CROSSHAIRS
00:17:20 1ST TEST w/FIX
00:18:00 2ND TEST
00:19:25 MOUSE INPUT CONSIDERATIONS
00:20:42 DEBUG RAYCAST
00:24:09 COLLISION LAYER FILTER DEMO
00:25:37 MULTIPLAYER DEMO
00:27:15 DEAD REPLICATION
00:28:08 FINAL DEMO


#shootenemy #gamedevelopment #3dmultiplayer #godotstartertemplate #godot #godottips #gametech #gamedev #indiedev #multiplayer #network #godotengine