Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParticlesMaterial in Particles2D cannot be made unique #18948

Closed
JarLowrey opened this issue May 16, 2018 · 14 comments
Closed

ParticlesMaterial in Particles2D cannot be made unique #18948

JarLowrey opened this issue May 16, 2018 · 14 comments

Comments

@JarLowrey
Copy link

Godot version:

3.0.2

OS/device including version:

Win10

Issue description:

When clicking "Make Unique" for a ParticlesMaterial, the setting does not last after saving and closing the scene. Upon reopening/running it will not be unique. Workaround is to duplicate the material in code

Steps to reproduce:
Try to make a Particles2D's material unique in the editor. Save + close the scene, reopen. Will not be unique.

Minimal reproduction project:

New Game Project2.zip

Comment out this line in Node2D.gd to test: $Particles2D.process_material = $Particles2D.process_material.duplicate(). I left it in to show that the scripting workaround actually works.

@timoschwarzer
Copy link
Contributor

How did you check that it was not made unique?

@JarLowrey
Copy link
Author

In the example project: make the material unique. The script runs and sets only 1 of the Particle2Ds to a different shape size. Both change size.

Also when you make it unique the material changes name (in the right panel). After you close+reopen the name reverts to its previous value, indicating that this value was not saved.

@eon-s
Copy link
Contributor

eon-s commented May 31, 2018

I have noticed this with SpatialMaterial too, duplicate a mesh with a material, try to make unique and modify some parameters and you'll see it may not be unique.

@JarLowrey
Copy link
Author

JarLowrey commented May 31, 2018

Yes I believe it has happened to me on some other materials, maybe Shape2D and something else? ParticlesMaterial is the one I noticed and could easily duplicate though. Pretty serious bug in my opinion

@bojidar-bg
Copy link
Contributor

Don't you mean to set it "Local to scene" rather than unique?

Local to scene would auto-duplicate it when loading the scene, while make unique would ensure it is not shared with other scenes (nothing said about other instances of the scene).

@eon-s
Copy link
Contributor

eon-s commented Jun 1, 2018

Make unique used to create a new resource (duplicated) in the same scene on duplicated nodes, now that option fails with some resources.

@JarLowrey
Copy link
Author

I've noticed this happens with materials and shaders, which can be difficult when trying to set_shader_params. You have to duplicate the materials/shaders in code before setting params.

@SiyahaS
Copy link

SiyahaS commented Jul 7, 2018

For a quick workaround, one may use duplicate on _ready() function

func _ready():
    $Particles2D.process_material = $Particles2D.process_material.duplicate()

@groud
Copy link
Member

groud commented Oct 2, 2018

According to my tests, this is fixed on master branch.
Please comment here if anyone can reproduce.

@groud groud closed this as completed Oct 2, 2018
@akien-mga akien-mga added this to the 3.1 milestone Oct 2, 2018
@Adz214
Copy link

Adz214 commented Dec 4, 2020

I've come across the same issue on v3.2.2.stable.official.

Saved 2 different Particle Resources with 2 different names, both made unique. When I change the color ramp on one, save close, open the other, both have been changed.

Edit: After duplicating the resource, that duplication seems to be unique.
2nd Edit: Is this a feature when "merge from scene" is used, as it happened in an Animation player as well. Had to duplicate & delete the first, as adjusting one in one scene adjusted both in both scenes.

@opyate
Copy link

opyate commented Apr 30, 2022

I've also encountered this bug: https://github.com/opyate/ggj2022-solo-entry/blob/bug_process_material_is_not_unique/scenes/player/Player.gd#L168

Both players get the same colour in their particle emitter. (Particles are emitted when they land on the ground, after jumping/falling)

(Here's my workaround, by duplicating the entire scene, one for each colour.)

v3.4.4.stable.official [419e713]

@Calinou
Copy link
Member

Calinou commented Apr 30, 2022

@opyate Please open a new issue with a minimal reproduction project attached.

@graydwarf
Copy link

Seeing this behavior in godot 4.2.stable. No matter what I do, I cannot make the GPUParticles2D.ParticleProcessMaterial unique. Changes to one instance are effecting all other instances. The duplicate workaround works. I don't have a repro available.

Changing the gravity for one instance changes it for all instances.
$GPUParticles2D.process_material.gravity = Vector3(0, 50, 0)

@AThousandShips
Copy link
Member

Please open a new issue with a reproduction project attached 🙂, but I can't replicate this myself with this, in what way does it not work to press Make Unique? It works fine for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests