+1 vote

I want to instance a scene and show it before each level in my game. So I use the instance method like -

var MyScene = load("res://Scenes/MyScene.tscn")
var myScene = MyScene.instance()

Now this works, but there is a problem. If I run any script on this scene to say modify size of text, this modification persists when I create another instance of this scene.

Even though when the second instance is being made, the first instance is freed, the second instance contains modification made on first instance (through script).

I want to have unique instances of the scene, which do not share modifications.

in Engine by (13 points)
edited by

Size of which text?
That Scene will contain other Ressources which may be shared between instances. You might need to make the specific ressource which you are altering unique.

@wombatstampede: I have made the resources unique already. That's not the problem. I'd like to change the size of same text in different instances of the scene. But looks like that is not possible right now in godot.

Maybe it is best when you share the part of code where you change the font size.

Do you create a new Instance of DynamicFont or BitmapFont and then use addfontoverride() of the label?

Please log in or register to answer this question.

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.

Categories