0 votes

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 physicsprocess(delta):

motion.y += 20

if Input.is_action_pressed("ui_right"):
    motion.x = 100
elif Input.is_action_pressed("ui_left"):
    motion.x = -100
else:
    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

Godot version 3.2.3
in Engine by (12 points)

Do you see any errors in the debugger?

how i can see the problems?

The bottom tab will show any errors

I pressed the bottom Tab and dont show nothing to me

Maybe you don't have any errors then

i think is a bug from godot you know

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

try to reinstall godot

1 Answer

0 votes

This "motion.y += 20" within a process is being calculated 60 times per second, reaching values ​​above 1200. Not counting this print () inside ison_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 moveandslide must be running out....

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

by (211 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.