0 votes

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 ?

asked Jun 16 in Engine by MagnusL3D (15 points)

1 Answer

+1 vote
Best answer

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.

answered Jun 17 by Calinou (4,117 points)
selected Jun 17 by MagnusL3D

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

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.