Issues with Print function

I managed to get stuck on the first course involving the Godot scripting language, oops.

I’ve got my level script identical to the one in the course (as far as I know), but nothing shows up in the output panel when the game is run. I tried to push through, and encountered a different issue when trying to print something from the player script: whatever I have in the test/print function runs twice. The “why would you do that” is the line I have running in the player script.

I’ve checked all the toggles on the right-hand side of the output panel just in case, but I’ve been unable to figure out how else to troubleshoot this. I’m sure it’s something small I’m missing. The printing twice issue also happens no matter if I’m running the full game file or just the player scene.

To be clear, the “hello, world” print isn’t firing, and the player scripts print function is firing twice? And have you reloaded the project?

Correct, yes, those are the problems I’m encountering. And yes, I’ve tried reloading.
Since it’s at the beginning of such a simple project, I’m going to see if just replicating what I’ve got so far in a new project file also ends with the same result.

Yeah try to remake the project up to that point from memory, use it as an experience to make sure you’re familiar with the subject matter that’s been taught so far. If you still have this problem then post both scripts (level and player scripts) and we can hopefully see what’s up

Hi,

couple of things i would check, just thinking out loud here on what my process might be.

so im seeing “why would you do that” output twice to the console.

i would first look to check the script that has that output line and check if theres anywhere in that script that might cause it to print twice.

if its in _ready() as well, and its only there once.

then i would check if that script is anywhere in the scene twice.
now theres a print statement there in the level script too, but thats not firing.

I would have a look at the level scene, see what scripts attached to that node, i suspect it might be the second player.gd and not a level_1.gd script.

have a go at that, just to see if thats it

Darren

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms