How to set editable children without original scene changing, while keeping scenes linked?

Godot Version

4.4.1.stable

Question

Title.

I feel like in the past, when I’ve selected editable children on an instanced scene, once I edit something in those instanced children, it doesn’t edit the source scene or other instances. However, I’m now working on an AnimationPlayer node that’s an editable child of an instanced scene, and upon looking back at the source scene’s AnimationPlayer, it has automatically updated itself with what I made in the instance, including animations and tracks with empty keyframes at the same timestamps. I also now cannot edit the timestamps of the keyframes in the instance’s editable children once they’re set (acting like it’s suddenly read-only), but if I go to the source AnimationPlayer and move the empty keyframes around there, it updates in the instance.

What’s going on here? With editable children turned on, I should be able to edit whatever I want in the instance or its children without the source or other instances of it in other scenes changing. Isn’t that the entire point of editable children? Everything not changed should still be driven by the source, of course, but this shouldn’t be a 2-way street of changes.

Also, “local to scene” is greyed out on all my resources with no apparent way of activating it, so that’s not a solution. I have no idea what’s going on there either.

I feel like this should be very simple. No one wants edited children to affect the original scene, if you wanted something edited at the source you’d just edit it at the source. Am I crazy?

The children’s resources are still shared, you may need to make them unique if you want each to have their own resource.

Maybe this should be a feature request on Github then? Seems like a no brainer right? Why would they be shared coming anywhere but from the source?

I’ve tried looking into that unique thing with no success. How can I do that for, say, an AnimationPlayer node? If you don’t mind.

For Animations inside an AnimationPlayer specifically you will see the “Libraries” property under the “AnimationMixer” section. You can right-click and select “Make Unique” on the animation library you want.

The reason this isn’t default behaviour is that sharing resources saves a ton of space and reduces disk reads, Godot does a lot to make sure resources are shared when possible and to only split them if done so explicitly. For example Animations can be rather heavy and I wouldn’t want to magically double my scene size because I looked at a editable child’s animation player.

Usually animations are pretty set-in-stone, maybe you are using them wrong if you need to change the animation per-instance? I’d recommend looking into tweens, but could you explain more about your situation?

I have a base scene for all projectiles (bullets, rocks, etc.) which share the same script and nodes, but swap out things like specific textures, animation frames, exported variable values, etc. I feel like I should be able to just instance the projectiles bare scene, fill in the blanks, and not affect the original, and I believe I have done this in past releases.

Try using Inherited scenes; have your base projectile be very “base”, keep the nodes but strip out any resources such as textures and animation libarires. Then right-click your base_projectile.tscn in the filesystem and select “New Inherited Scene”. This acts a lot like editable children, but keeps the same root node of the scene, and you can fill in the empty resources easier than you would overwriting full ones.

If the base projectiles scene has changes made it it (add/remove nodes, shift common values, etc.), will that affect the inherited scenes as it would with instantiated scenes?

Yes the inherited scene will also adopt future changes made to the base scene. assuming they are not already overwritten i.e.

  1. base speed starts at 100
  2. inherited speed overwrites to 200
  3. base speed changed to 50
  4. inherited speed stays 200 only because it’s previously overwritten

This functions exactly like changes to editable children and instantiated scenes.

1 Like

sounds awesome, I’ll give it shot. Thanks Garrett

So, I gave it a shot and it’s doing the exact same thing.
New inherited scene:

Source (projectile):

The source was blank until I made the track in the new inherited scene. Then it auto-updated.

Even setting it to “Local to scene” in the inspector (only possible from the source scene, greyed out in inherited scenes at same boolean as source), this still happens.

“Local to scene” still shares the resource in the editor, it’s only in-game when instantiated is the resource duplicated for run-time edits.

By blank I meant the Animation player has no animations what so ever, the “Libraries” section is empty. Otherwise you are trying to edit a Animation Resource that is shared, even if it starts with no data.

gotcha. I think I understand. I don’t know if I appreciate the engine behavior this way, but I can live with it. I just made the blank animationplayer node without any animations in it, and creating them totally from scratch in the new scene (inherited or instantiated) seems to work.