Godot error Introduction to varibles

I am trying to complete the challenge

extends Node2D


# Called when the node enters the scene tree for the first time.
func _ready():
	pass # Replace with function body.

# Called every frame.
func test():
	var  my_int = (13 + 7) * 8
	print(my_int)

It doesnt show the output anywhere
this is what shows in the output field

Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 516.40 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1660 Ti

Morning,

its awesome that your playing around with the code :muscle:

if its just this script, remember that for a function to run it has to be called as well as defined/created.
so to get your test() function to run, you could try this.

see if that then shows an output to the console.

extends Node2D


# Called when the node enters the scene tree for the first time.
func _ready():
	test()

# Called every frame.
func test():
	var  my_int = (13 + 7) * 8
	print(my_int)

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

Privacy & Terms