How to pass data from a particle shader to the CPU?

Godot Version



For context: i’m trying to spawn particles in 2D which follow the player and trigger something if they reach their target. Like bullets or experience gems in vampire survivors like games. I can check if they reached the player in the shader but to my knowledge there is no way to communicate from the particle shader to the CPU.

I don’t want to spawn Nodes and handle the collision and movement via script since this sounds pretty expensive. There could be hundreds if not thousands of particles on the screen at any time.

Do you have any idea how i could tackle this problem?