Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawn objects don't disappear when created from _physics_process #8

Open
geegaz opened this issue May 12, 2022 · 2 comments
Open

Drawn objects don't disappear when created from _physics_process #8

geegaz opened this issue May 12, 2022 · 2 comments

Comments

@geegaz
Copy link

geegaz commented May 12, 2022

Hello !

Always when using any of the draw_box, draw_line_3d and draw_ray_3d functions from _physics_process, the drawn objects don't disappear - they disappear as expected when the functions are called from _process.
This causes the game to slow down and become unplayable after a few seconds, due to the huge amount of nodes created every second.

I'm using Godot 3.4.4, with the addons "heightmap terrain" and "trails"

Here's a video of the issue:
https://user-images.githubusercontent.com/39198556/168067640-1a3bf8f0-33f0-4da4-9581-b0af3690dce5.mp4

I tried replacing Engine.get_frames_drawn() by Engine.get_idle_frames() in debug_draw.gd, but it didn't change anything. Do you have an idea of what could be causing it ?

@MGilleronFJ
Copy link

MGilleronFJ commented Jul 22, 2022

Do you have errors when this happens? Did you pause the game? Is debug_draw an autoload or did you add it as child of something in your scene?
If there is no error I suspect it could be the way frames increment, causing drawn items to miss their lingering removal frame.

@Zylann
Copy link
Owner

Zylann commented Jul 24, 2022

I tried it in the godot4 branch and that problem did not happen. Did not happen either in the master branch. The only difference was a slight trail behind moving lines, which is normal due to the difference in execution frequencies of _physics_process and _process, but they dont remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants