#I do not understand why my code is not working
11 messages · Page 1 of 1 (latest)
First, you should check the warnings in the debugger window after it crashed. Usually it has a lot of stuff in there that can be ignored but you never know.
Next, you could add a breakpoint ( click left of line number ) to the line 35 shoot(). Now you can use the debugger to go step by step/go into each line of code to see exactly where it'll crash. You will also have a live view of all variables and their content which can be very helpful.
I dont know how to debug code. I know none of the language used. so I don't really know what any of that meant. I legit just started coding 2 days ago 😭
oh, i see 😄
there's a debugger button at the bottom. while running, after you ran your game it will show warnings and/or errors it encounters during execution. it's always a good idea to check there first when encountering a problem.
the breakpoints i mentioned are explained here https://docs.godotengine.org/en/stable/tutorials/scripting/debug/overview_of_debugging_tools.html#script-editor-debug-tools-and-options
This guide will give you an overview of the available debugging tools in the engine. Godot comes with a powerful debugger and profilers to track down bugs, inspect your game at runtime, monitor ess...
when your game encounters such a breakpoint during execution it will look like this
i marked the button panel you can use to step through your code line by line and see exactly what is happening