Black screen in debug mode

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bloopeiro

Hi does anyone know how I can solve a problem in godot’s debug mode? When I start it gets all black screen, I already changed GLES3 to GLES2 and nothing

Here are all the programming lines of my project:

extends KinematicBody2D

const UP = Vector2(0, -1)
var motion = Vector2()

func _physics_process(delta):

motion.y += 20

if Input.is_action_pressed("ui_right"):
	motion.x = 100
elif Input.is_action_pressed("ui_left"):
	motion.x = -100
	motion.x = 0

if is_on_floor():
	print("esta no chão")
	if input.is_action_pressed("ui_up"):
		motion.y = -300
move_and_slide(motion, UP)

this one here is the player script okay

Do you see any errors in the debugger?

exuin | 2021-03-31 16:25

how i can see the problems?

bloopeiro | 2021-03-31 21:36

The bottom tab will show any errors

exuin | 2021-03-31 23:04

I pressed the bottom Tab and dont show nothing to me

bloopeiro | 2021-03-31 23:20

Maybe you don’t have any errors then

exuin | 2021-03-31 23:20

i think is a bug from godot you know

bloopeiro | 2021-03-31 23:50

Are you sure? Can you give more info about your project?

exuin | 2021-04-01 00:15

try to reinstall godot

Mrpaolosarino | 2021-04-01 13:03

:bust_in_silhouette: Reply From: Firty

This “motion.y += 20” within a _process is being calculated 60 times per second, reaching values ​​above 1200. Not counting this print () inside is_on_floor () that inside a _process simply blocks the processor.

The _process and _physicsprocess functions make 60 calls per second. The term += is doing the following calculation for each call: 0+20, 20+20, 40+20 … Print functions if they are called many times per second lock the engine, so they should not be inside functions like that, the engine is trying to print this 60 times a second…

And another detail, as the motion.y is increased extremely fast, the move_and_slide must be running out…

Use motion.y = 20 and remove the print().