[9] Let's Make a Godot Space Shooter: Firing Cooldown
Vložit
- čas přidán 24. 07. 2020
- We delay the firing of our bullets to add a fire cooldown effect to the ship! Let’s Make a Godot Space Shooter together - a series covering basic Godot concepts and workflows to create a full PC, mobile, and controller-supported game!
See my website (source code link available per-episode!): codenmore.github.io/
Follow me on Twitter - @CodeNMore - / codenmore
Teaching to understand all subjects to the fullest extent!
Thumbnail: Godot Logo (C) Andrea Calabró Distributed under the terms of the Creative Commons Attribution License version 3.0 (CC-BY 3.0). creativecommons.org/licenses/.... - Jak na to + styl
Another thing you can do is change 'Input.is_action_pressed()' to 'Input.is_action_just_pressed()' which makes it so only one bullet gets shot everytime you press the button. You can't hold it down to keep shooting though.
In case anyone has a problem with the timer not finishing, make sure to enable "one shot" in the timer node settings
Man, I'm so thankful for these videos. I love how you break down and explain what's happening and don't just give us the code to use and forget later. Keep up the good work and thanks a lot!
So much knowledge!!😁 Nice tutorial as always.
keep it up!! ur video is very helpful and worth to watch. I wish u all the best and release more tutorials of godit !
Super appreciate the tutorial! This was super helpful
Dude i love u, i Washington searching how to do it for so long thanks !
(It work on godot 4 btw)
You just saved my ass. Thank you so much!
Thanks bro
Weird bug I experienced..updating the fireDelay in script wasn't doing anything. Once I messed with the fireDelay in Inspector...seemed to fix whatever was going on.
I try to use wait time in Timer, not define firedely in code. It seems also OK
Hi. What if i want to shoot the bullets in where my character/player is facing? how would I do it?
This tutorial has been great, even though it's several years old now and some things within Godot have changed. I seem to have bodged this step though; can't get the Timer to work. I've probably done something stupid, but does anyone have any ideas? The debugger is returning nothing. EDIT: Yep, being stupid. Left out the closed brackets after ".is_stopped():"
better to use Input.is_action_just_pressed
Error on the firedekaycode
I'm first
hey, i need help
if Input.is_action_pressed("shoot") and fireDelayTimer.is_stopped():
for child in firingPositions.get_children():
if child.functioning:
fireDelayTimer.start(fireDelay)
var bullet = plBullet.instance()
bullet.global_position = child.global_position
get_tree().current_scene.add_child(bullet)
You just saved my ass. Thank you so much!