0 votes

i use CPUParticles2D, i want create some particles in place of a deleted object. Can you show the code how to do this?

in Engine by (141 points)

2 Answers

0 votes
Best answer

Consider my scenario whereas I have a player shooting against enemy. For this use case I have created 3 separate scenes
1. Player
2. Bullet
3. Enemy

But the moment bullet hit the enemy both bullet and enemy destroyed as expected. But what I want is the moment bullet hit the enemy there should be a explosion. Get the position of a bullet before calling queue_free() on it and show the Explosion scene on the position.

HERE COMES THE NEW SCENE
4. Explosion

by (109 points)
selected by

although I myself have already found a way to solve this problem, but thanks all the same. I did as you said.

0 votes

Last week I stumbled upon a Super Mario clone tutorial, in which they show how to create a particle effect after a block is broken by the player.
https://www.youtube.com/watch?v=WUKkheFTzx4
I recommend skipping to 27:50 as that is where he begins going through the particle process.

by (298 points)
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.