2D culling particles?

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

Hello,

This will be my first question here so I hope I am doing it right.

I have a Area2D scene that acts as my bullet in a 2D project, and to that I have a child Particles2D that creates a trail after the bullet as it is shot. The Area2D also has CollisionPolygon2D and a Polygon2D that makes up it’s visual and collision testing.

The bullet has a timer so it gets removed after a certain time if nothing is hit. And generally everything works as expected, except when I shoot the bullet outside the screen, then my trail disappears instantly as if the culling is only happening around the CollisionPolygon2D or Polygon 2D shapes.

Should I perhaps not have the trail as a child inside the bullet scene or where am I going wrong here ?

:bust_in_silhouette: Reply From: Calinou

If you use a Particles2D node (GPU-based particles), you should enlarge its Visiblity Rect (in the Drawing section) so that it covers the whole area that the trail may cover at most. This way, particles won’t be culled when the emitter leaves the screen.

This doesn’t affect CPUParticles2D, whose visbility rectangle is computed automatically as of 3.1.

Aha ! and here I was looking for “culling” something ! thanks works perfectly !

MagnusL3D | 2019-06-17 18:40