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 ?

in Engine by (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.

by (11,901 points)
selected by

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.
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.