+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 (273 points)

3 Answers

+2 votes

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

by (830 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)
+8 votes

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

by (304 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 Frequently asked questions and 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 [email protected] with your username.