Complete 3D Shooting Mechanics - Godot 4 FPS Tutorial

preview_player
Показать описание
In this Godot 4 tutorial we create implement complete shooting mechanics for a first person shooter game including how to make a weapon. The covered topics include gun animations, projectile bullets, complex bullet collisions with body parts and weakpoints, dying animations, and enemy despawning. These mechanics can be used for many types of games, including FPS, horror, survival, RPG, etc. All of this code works with Godot 4.1.

Assets:

Рекомендации по теме
Комментарии
Автор

TIPS:
1. Hold control while you click and drag a node from the scene hierarchy to the script to create a full @onready var
2.There is a Translate() function that changes the nodes position. Could simplify the bullet movement slightly.

samwholearns
Автор

Just started on the 3D game development journey in Godot and the 3 tutorials are super helpful. Thanks!

chrisl
Автор

Thanks for the tutorial! There is not many godot 4 tutorials so yours are a huge help to beginners

supermario-N
Автор

These are incredible. I love how succinct they are. Keep this style up!
This is some of the best godot content I've come across so far

ChristopherSprance
Автор

This has been one of the most helpful tutorials I’ve found so far. Thank you!

Blake.Bilderback
Автор

I had a problem where my bullet had multiple problems, so here is my solution for future generations.
The problems; my bullet spawned way over my head and fired in a direction that wasn't quite where I was looking but picked a direction relative to how rotated my camera was. the bullet also curved as I turned my camera mid-flight.
the solution; I replaced with this gets the root node of your level and makes the new bullet a child of that.

DubbleKoi
Автор

awesome workaround for the collision shapes of enemies. Thank you

karimsantoro
Автор

I think the collision boxes now work with the animationtree without having to redo them. They reworked AnimationPlayer and AnimationTree between 4.1 and 4.2 so it could be related to that.

Rawrqual
Автор

Looking great, thank you. I’ve added sound and made it quite a bit darker. Very fun to shoot those undead.

robvreede
Автор

When I press the fire button, the bullets aren't where the ray cast is. They also change position (On the Y axis) depending on where I am in the play space

Bullet:
extends Node3D

const SPEED = 40.0

@onready var mesh = $MeshInstance3D
@onready var ray = $RayCast3D


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position += transform.basis * Vector3(0, 0, -SPEED) *delta

Gun:
@onready var gun_animation =
@onready var gun_barrel = $Sketchfab_Scene/RayCast3D

var bullet =
var instance

func _process(delta):
if
if !gun_animation.is_playing():

instance = bullet.instantiate()
instance.position = gun_barrel.global_position
instance.transform.basis =

gwmm
Автор

You have a fantastic foundation to create a simple COD zombies game, maybe. i have near zero experience in game dev so i truly wouldnt know

regardless, these tutorials are awesome

greji
Автор

PERFECT : simple, fast and very well explain for newbies

artiop
Автор

I i hate the way people always rush to do stuff without letting viewers see it

akwasiasanteampong
Автор

After working with nodes in Unreal for a long time is't such a joy to see the real code. Thank you.

visualcortex
Автор

Another great tutorial with all the code working as it should.
It is fast paced which allows you to put more ideas and solutions into the video without dragging on.

andypandy-pyzc
Автор

What a legend, fantastic video mate, keep them coming.

Max-sfim
Автор

Nice tutorial. GJ on being crispy clear on ur words!

ndriqa
Автор

10:25 well this is awkward now... in your previous tutorial you were only talking about the three animations "standup", "run", "attack", not about the "die" animation.
How can I now add a fourth animation to the already existing model? If I reimport from blender, all the previous work (position track in standup, hit-frame in attack, animation-renaming) will overriden right?
Can I somehow retarget an existing animation onto a different model (import 2nd zombie model just with "die" animation and then retarget to existing zombie)?

paulchen
Автор

I recalled your video many times, so many good and essential stuff around it! Thanks for the knolage shortcut!!!

D.E.Nicolas.Goncalves
Автор

God Bless you bro, this tutorial is amazing!

ChuckyMaster