Hi! I'm new to game development and Godot. I've encountered a weird error and I hope you guys can help me. Basically, I have a gatling gun that will only shoot if there's an asteroid on it's assigned area. What I did was add the asteroid on a group based on area. Now, I'm using get_tree().has_group() function and it works fine when I'm using print() for checking result but it does not respond(hangs) when using the function in a conditional statement provided the proper indention unlike below. There is no error when I click debugger>errors and I have no idea what I did wrong since printing the output works fine.
https://imgur.com/a/tfYJpn5
update:
I was calling the shoot() inside ready() so I thought it gets stuck in ready() since shoot() is an infinite loop. What I did now was use delta in process() for cooldown and it's working as intended but I will get a slight inaccuracy in time depending on how fast the process executes. Am I doing it right or is there a proper way of doing it? Shoud I use physics_process() instead?
https://imgur.com/a/c6HuV6u