godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.95k stars 3.22k forks source link

Scene recognizes @tool only on open #10168

Open GniLudio opened 2 weeks ago

GniLudio commented 2 weeks ago

Godot version: v4.3.stable.official [77dcf97d8]

Issue description: When adding (or removing) the @tool-tag from a script, opened scenes don't detect the change automatically. Only when closing and reopening a scene, the scene correctly detects the added/removed @tool.

Documentation Page: Running code in the editor

Steps:

  1. Create a scene
  2. Add the script to the scene
    • Add @tool to the start of the script
    • Add print("Hello") to the _process function
  3. Switch back to the scene -> no 'Hello' appears in the console
  4. Close and reopen the scene -> 'Hello' appears in the console
@tool
extends Node2D

func _process(delta: float) -> void:
    print("Hello")