Having instances act independently?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mellon
:warning: Old Version Published before Godot 3 was released.

So I have two instances of the same scene but I have noticed that if an event affects one instance of the scene it affects the other(in my case it plays an animation). How do I have the instances act independently of each other? Thank you!

I can’t reproduce it. My instances work independently. Is there a better description of the problem?

avencherus | 2017-01-18 02:00

What did you do exactly to have this problem? Did you connect signals? What is your scene structure?

Zylann | 2017-01-18 02:28

I have an animation that changes a mesh’s diffuse texture which when played on one instance changes the others diffuse texture.

Mellon | 2017-01-18 03:23

:bust_in_silhouette: Reply From: gonzo191

Seems like you have duplicates of the same instance rather than separate instances. I’ve never experienced that sort of behaviour with instances in Godot. Try deleting one instance then create a new child instance using the chain icon.

Duplicates still won’t be shared, they should work separately wether they are copies or instances (which happens to be kinda the same thing).

Zylann | 2017-01-18 02:27

Yeah I know, seems like something else is at play.

gonzo191 | 2017-01-18 02:52

I made extra sure they aren’t duplicates after I found as much on the internet. Each node is made by selecting the chain icon and then selecting scene, but I’ll check everything again and make an example project to see if there’s something weird going on.

Knowing this isn’t a bug in the engine is great though, all I need now is to find where I made a mistake.

hello_world | 2019-11-12 14:52

:bust_in_silhouette: Reply From: avencherus

It’s not an issue of instancing or the animation player, you will want to make sure your mesh’s materials are unique. If they’re referencing the same material as a resource, any changes will be reflected across all others that use it.

I guess this is right answer. :slight_smile:

volzhs | 2017-01-18 04:03

Oh snap! I think that’s the culprit. I was so hung up on AnimationPlayer resources being unique that I didn’t think about Sprite resource being shared! Sorry, will be more careful from now on.

hello_world | 2019-11-12 14:54

and don’t forget to check your mesh’s resources and set it to be local to scene. I found out the hard way

19PHOBOSS98 | 2020-02-13 04:02