Does Godot cache+restore objects when there are too many?

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

Hi, I encountered a really weird situation.

Setup:

  • Lots of RigidBody2D nodes with text labels, dynamically spawned at the start of Godot runtime. No physics / collision / gravity / force
  • Draggable by mouse (sets position of the dragging node directly to the mouse global position) . Viewport can be zoomed in/out.

Problem:

  • The RigidBody2D nodes can be dragged around and settle its position once the mouse click has been released.
  • However, when the Viewport is zoomed out all the way to reveal all nodes altogether (approx 3000 objects ), whenever a RigidBody2D is dragged and released, it will “flick” back to its original position.

I’m using _physics_process and have double checked that no other places are updating each node’s positions or storing them.
This seems to me that Godot is somehow caching the objects when there are too many?? Can anyone confirm this or have encountered a similar situation?

P.S. This cannot be replicated when I use a small amount of RigidBody2D nodes, so I suspect it might has something to do with how Godot handles large amount of objects.

Which graphics card model and rendering backend are you using? Can you reproduce this after disabling batching in the Project Settings?

Calinou | 2021-05-25 16:52