# How to let changes on inspector effective immediately like changing the SpriteFrames of an AnimatedSprite2D?

**URL:** <https://forum.godotengine.org/t/how-to-let-changes-on-inspector-effective-immediately-like-changing-the-spriteframes-of-an-animatedsprite2d/40232>\
**Category:** Help\
**Tags:** godot-4, game, 2d, gdscript\
**Created:** [December 30, 2023, 2:17pm UTC](https://forum.godotengine.org/t/how-to-let-changes-on-inspector-effective-immediately-like-changing-the-spriteframes-of-an-animatedsprite2d/40232 "2023-12-30T14:17:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axin](https://forum.godotengine.org/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@Axin](https://forum.godotengine.org/u/Axin)\
**Post date:** [December 30, 2023, 2:17pm UTC](https://forum.godotengine.org/t/how-to-let-changes-on-inspector-effective-immediately-like-changing-the-spriteframes-of-an-animatedsprite2d/40232/1 "2023-12-30T14:17:14Z")

</div>

### Godot Version

godot4.2

### Question

The thing is, I am going to create a scene called Swordman. The swordman scene have a child node in type of AnimatedSprite2D to play various animation. There are two human camp in my game, one is red camp, and another is blue camp. So I prepared two SpriteFrames for the AnimatedSprite2D node, corresponding to red and blue camps respectively. When building the main scene, how can I change the SpriteFrames of instantiated swordman scene, and how to let the changes effective immediately in the editor like editing the subscene? 🤔

---

<div class="post-metadata">

**Author:** ![Exerion](https://forum.godotengine.org/user_avatar/forum.godotengine.org/exerion/32/4462_2.png) [@Exerion](https://forum.godotengine.org/u/Exerion)\
**Post date:** [December 30, 2023, 2:28pm UTC](https://forum.godotengine.org/t/how-to-let-changes-on-inspector-effective-immediately-like-changing-the-spriteframes-of-an-animatedsprite2d/40232/2 "2023-12-30T14:28:50Z")

</div>

Do you mean `@tool` scripts?

> **[Running code in the editor](https://docs.godotengine.org/en/stable/tutorials/plugins/running_code_in_the_editor.html)**
>
> What is@tool?:@tool is a powerful line of code that, when added at the top of your script, makes it execute in the editor. You can also decide which parts of the script execute in the editor, which...
