Shooting system is unstable and projectile delinks itself.

Godot Version

4.6.2

Question

I'm a complete beginner and I've just been trying my best, but I'm completely confused and helpless. Sometimes my combat system breaks completely on its on. One time I tried copypasting a fixed version of my script someone gave me into the wrong file, I simply Ctrl+Z twiced and somehow all the projectiles stop generating. Twice in a row after that, I've had problems where only the player's projectiles become delinked and null. I've been told to try debugging lines but they either output null or they don't output anything at all. What happened last time was that it worked normally but I wanted the character to move a little fast so I changed his speed variable from 250, to 300. That somehow broke the projectiles. Each time this happens, the "slash_scene" variable empties itself in the Inspector. Adding the slash_projectile.tscn fixed it the middle time, but not the most recent. The first time I delt with this, I had no choice but to load a back up and redo a lot of my work, but it's so frequent, I can't progress until I learn what's happening

Posting code without context isn’t really helpful.

  1. What’s your scene tree look like? Attach a screen shot. Describing it is not helpful.
  2. What nodes are those scripts attached to?
  3. Is there a reason you decided not to format the code in your post?

I didn’t format it because I’m new to this.

To diagnose your issue, people need to see your code as well - meaning the contents of your scripts.

Please do not post them as screenshots. Instead, create formatting blocks using a triple backtick.

func example():
    # Formatted code will look like this