0 votes

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!

in Engine by (24 points)

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

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

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

2 Answers

0 votes

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.

by (122 points)

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

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

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.

+7 votes

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.

by (5,192 points)

I guess this is right answer. :)

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.

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

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.