0 votes

I have a simple 2D top down shooter with a static tower constantly shooting at me every 1.0 seconds. The bullit is a rigid body with a sprite and collision shape attached. On the bullet itself is also a script destroying the bullet after 5.0 sec. While playing everything works fine with 60fps until the first bullet starts to destroy itself. Suddenly the framerate drops down to 5 fps and gets back up after a view seconds.

I tried to find out what causes this issue: colliders and reducing the life of the bullets did not help. So far I got like up to 15 different bullets at highest. I can not believe that that amount of rigid bodies is already too much, is it?

Running on:
Win 10 64-bit
cpu = Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 CPUs), ~4.0GHz
gpu = NVIDIA GeForce GTX 970

in Engine by (27 points)

Does this happen only when the first bullet is destroyed or when any bullet is destroyed?

It starts with the destruction of the first bullets and goes on for quite a while till it gets better again. As far as I can tell the exact amount of bullets is not crucial for this to happen.

If you alter the position of the bullets directly (e.g. position += something) try switching them to a kinematic body and make sure to set the position inside physics_process

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.