Godot 4.X Tower Defense Tutorial - Part 08 (Turret Rotation)
Hey everyone, hope you're doing GREAT!
In this tutorial, we'll get those turrets rotating and targetting the enemies, in readiness to begin firing at them. It's a confusing subject to be honest, that continues to confuse me too! I hope it makes sense to you, so please let me know your thoughts in the comments.
Hoping you're enjoying the series enough to throw a like down, and maybe a subscribe if you're new to the channel. Source code (version 4.2) is available via the link below.
As I mentioned, I'm in Rome for a week, so the next tutorial will be over a week away. But I will work on this for you folks so you've got something to look forward to ;-)
Have fun!
Links:
Github source code: https://github.com/WideArchShark/godot-tower-defense/tree/tutorial_08
Godot rotation tutorial: https://docs.godotengine.org/en/stable/tutorials/3d/using_transforms.html
Previous State Chart tutorial: https://www.youtube.com/watch?v=hyyDrzqbcsw
Chapters
0:00 Introduction
1:00 Rotation logic used overview
4:50 Correction - adding the correct Node3D
6:50 Adding turret states
8:30 Pending state setup
11:38 Acquiring state setup
13:48 Attacking state setup
16:35 Handling enemies that go out of range
21:20 Handling enemies that use queue_free()
25:00 A different targeting method!
26:30 Prologue!