When I convert Particles to CPUparticles, my game crash

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

I already made some code when the node used to be a Particle, maybe there’s some incompatibility?
The node is loaded and instanced, than added as a child to the scene. After that the emitting and position properties are changed and that’s it.

When I try to run the game with the node as CPUparticle, it just goes black, just like if I setted the node to be a Sprite or anything tottaly incompatible with the Particle class.
If I change the type of the node to Particle again, everything starts working fine.

There’s any difference between the properties of Particles and CPUparticles?

Does the debugger states an error?

klaas | 2020-09-02 05:29

Hi! No, it doesn’t.
But the way the game breaks it’s pretty much like when I, for exemple, turn “emitting” false for an Sprite node.

Lfzinho | 2020-09-03 00:10

My experience so far is… Godot chrashes only on cyclic calls.

klaas | 2020-09-03 04:58

:bust_in_silhouette: Reply From: Lfzinho

Hey, I found the problem.
As I said, I did some code with the particle before.
It turned out that the incompatibility was in the pretty first line of code:

extends Particles2D

So I changed the “Particles2D” to “CPUParticles2D” and that’s it.