Godot Engine

Godot Engine

Partickes2D Emitting
how to reproduce particles when picking up a coin? just write specific lines, no need to try to explain

NO, $ Partickes2D.emitting = true DOES NOT WORK
Last edited by жовтогарячий; Nov 26, 2022 @ 2:25pm
< >
Showing 1-10 of 10 comments
Baroon Valm Jun 18, 2021 @ 11:20pm 
This is Not enough information. if Particles2D are a child of the coin and you are removing the coin obviously that line of code Won't work.
Baroon Valm Jun 18, 2021 @ 11:37pm 
Really hard to say without knowing what you are doing right now to know what's wrong.

Here's how I'd go about it:
Coin Picked up pseudo code:
If Picked up - change to Particles
or
If Picked up - Add Child Particles to Coin, Remove Child Particles From Coin, Pass the Child to Root, Tell Root to Spawn that Passed Child (as in Reparent from Coin to Root)

Just adding particles to coin will result in no particles if the coin is deleted because the particles are a child of the coin and all of the children of the coin are removed.
Baroon Valm Jun 18, 2021 @ 11:59pm 
you should look up the Docs in godot, they've got all the methods you'll need there, and the parameters that you need.
Baroon Valm Jun 19, 2021 @ 12:03am 
The methods you should look at are:
1.
replace_by()

2.
add_child()
remove_child()
connect()
get_parent()
Baroon Valm Jun 19, 2021 @ 1:59am 
The Particle Node Reference for the Particle Effect that you want to replace it by... same thing as if you were to use add_child()
Baroon Valm Jun 19, 2021 @ 2:11am 
var coin=load(insert coin resource (.tscn/.scn))
var child=coin.instance()
add_child(child)
Matt [Linux] Jun 19, 2021 @ 3:26am 
Originally posted by Розочка Ризотто:
Originally posted by Baroon Valm:
The Particle Node Reference for the Particle Effect that you want to replace it by... same thing as if you were to use add_child()

I can't use Add_child either, I don't know what to write in brackets

The first option seems to me more concise, so I decided to use it.
I read the documentation and didn't understand anything. What is written there is intended for people who already understand something in coding, but this is clearly not me. I'm more of an artist.

you would really benefit a lot from working your way through the examples in the docs. you should come away from that understanding everything the above posters have just said.

its worth your time, trust me ;)
Sigmund Froid Jun 20, 2021 @ 9:12am 
Originally posted by Розочка Ризотто:
just write specific lines, no need to try to explain
That's the wrong attitude, because if other people just write your code for you, you won't understand why it works and if it breaks you can't fix it.
And we can't just write lines out of thin air if we don't understand what your code is, so maybe do us the favor of posting what you have, then maybe we can explain what's wrong so you can fix it.

Originally posted by Розочка Ризотто:
I don't understand what needs to be written in parentheses after replace_by so that after the coin is removed the particle effect is reproduced
That's why everyone tells you to look at the documentation, because that's the purpose of the documentation.

Originally posted by Розочка Ризотто:
I read the documentation and didn't understand anything. What is written there is intended for people who already understand something in coding, but this is clearly not me. I'm more of an artist.
Then maybe first learn the basics and then start actually working on code. If you can't work with the documentation, we can't help you much either.

Sorry if I sound rude, but trying to code without understanding code and more importantly - without wanting to understand code - is a fool's errand and won't get you far.
Sigmund Froid Jun 21, 2021 @ 4:45am 
Regarding the add_child and replace_by functions. you're supposed to add a node into it, in this case your particle emitter. You can either use load("path_to_scene").instance() to create a new node or if it's already there on runtime get_tree().get_root().get_node("name_of_the_node") to fetch it out of the SceneTree
Bii Jul 23, 2021 @ 10:34pm 
You could instance a particle emmiter 2d scene
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Jun 18, 2021 @ 11:14pm
Posts: 10