+3 votes

I notice in the editor there is a make unique option on some of the resources. how would I go about getting that functionality through code?

in Engine by (268 points)

3 Answers

+1 vote

Resource has a method duplicate(). It returns the copy of the resource.

by (822 points)
+1 vote

To expand upon @GlaDOSik's answer, I'm pretty sure this is exactly what you'd put in the code, res being the path to the resource:

res = res.duplicate()
by (32 points)
+7 votes

Very old post, but just for future people googling this.
In the resource parameters enable "Local To Scene"
enter image description here

by (287 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.