I've started wanting to code again due to godot 4 being released but I'm still new as well as being dependent on coding tutorials and my raycast wont detect other groups and wont print anything out here's my code and I apologize in advance if the code is horrible.

extends Node

var fire_rate = 0.5
var clip_size = 20
var reload_time = 1
var current_ammo = clip_size
var can_shoot = true
var reloading = false

@onready var raycast := $neck/camera3D/RayCast3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
	pass 
	if Input.is_action_just_pressed("primary shoot") and can_shoot:
		if current_ammo >0 and not reloading:
			
			print("shot")
			
func check_collision():
	if raycast.is_colliding():
		var collider = raycast.get_collider()
		if collider.is_in_group('badman'):
			print('badmandead')

I'm assuming it's because your check_collision function is not being called in the _process loop. So:

func _process(_delta: float) -> void:
	pass 
	if Input.is_action_just_pressed("primary shoot") and can_shoot:
		if current_ammo >0 and not reloading:
			check_collision()
			print("shot")

    Amon I have one finale question where is the best place for me to start really learning Godot coding? I feel tutorials set me up for failure because I truly don't know what the code does and how it works

      yee2343 Well, I'm in the same boat as you are. I've only just started with Godot and GDScript. I guess the only way is trial and error. There are loads of tutorials that teach you the basics and I mean the absolute basics for example, variables, loops, functions, function parameters, class's etc. It's best to start with those so you get a good idea on how programming languages work.

      Apologies that I couldn't provide you with a true definitive answer to your question.

        Amon your a good man, a decent amount of the basics I understand because of math

        Tomcat I think thats the right start because I was able to fix a reloading problem I had without the need to ask someone else for help.