class_node.rst 174 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Node.xml.
  6. .. _class_Node:
  7. Node
  8. ====
  9. **Inherits:** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`AnimationMixer<class_AnimationMixer>`, :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`, :ref:`CanvasItem<class_CanvasItem>`, :ref:`CanvasLayer<class_CanvasLayer>`, :ref:`EditorFileSystem<class_EditorFileSystem>`, :ref:`EditorPlugin<class_EditorPlugin>`, :ref:`EditorResourcePreview<class_EditorResourcePreview>`, :ref:`HTTPRequest<class_HTTPRequest>`, :ref:`InstancePlaceholder<class_InstancePlaceholder>`, :ref:`MissingNode<class_MissingNode>`, :ref:`MultiplayerSpawner<class_MultiplayerSpawner>`, :ref:`MultiplayerSynchronizer<class_MultiplayerSynchronizer>`, :ref:`NavigationAgent2D<class_NavigationAgent2D>`, :ref:`NavigationAgent3D<class_NavigationAgent3D>`, :ref:`Node3D<class_Node3D>`, :ref:`ResourcePreloader<class_ResourcePreloader>`, :ref:`ShaderGlobalsOverride<class_ShaderGlobalsOverride>`, :ref:`SkeletonIK3D<class_SkeletonIK3D>`, :ref:`StatusIndicator<class_StatusIndicator>`, :ref:`Timer<class_Timer>`, :ref:`Viewport<class_Viewport>`, :ref:`WorldEnvironment<class_WorldEnvironment>`
  11. Base class for all scene objects.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names.
  16. A tree of nodes is called a *scene*. Scenes can be saved to the disk and then instantiated into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects.
  17. \ **Scene tree:** The :ref:`SceneTree<class_SceneTree>` contains the active tree of nodes. When a node is added to the scene tree, it receives the :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification and its :ref:`_enter_tree<class_Node_private_method__enter_tree>` callback is triggered. Child nodes are always added *after* their parent node, i.e. the :ref:`_enter_tree<class_Node_private_method__enter_tree>` callback of a parent node will be triggered before its child's.
  18. Once all nodes have been added in the scene tree, they receive the :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` notification and their respective :ref:`_ready<class_Node_private_method__ready>` callbacks are triggered. For groups of nodes, the :ref:`_ready<class_Node_private_method__ready>` callback is called in reverse order, starting with the children and moving up to the parent nodes.
  19. This means that when adding a node to the scene tree, the following order will be used for the callbacks: :ref:`_enter_tree<class_Node_private_method__enter_tree>` of the parent, :ref:`_enter_tree<class_Node_private_method__enter_tree>` of the children, :ref:`_ready<class_Node_private_method__ready>` of the children and finally :ref:`_ready<class_Node_private_method__ready>` of the parent (recursively for the entire scene tree).
  20. \ **Processing:** Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback :ref:`_process<class_Node_private_method__process>`, toggled with :ref:`set_process<class_Node_method_set_process>`) happens as fast as possible and is dependent on the frame rate, so the processing time *delta* (in seconds) is passed as an argument. Physics processing (callback :ref:`_physics_process<class_Node_private_method__physics_process>`, toggled with :ref:`set_physics_process<class_Node_method_set_physics_process>`) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine.
  21. Nodes can also process input events. When present, the :ref:`_input<class_Node_private_method__input>` function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the :ref:`_unhandled_input<class_Node_private_method__unhandled_input>` function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI :ref:`Control<class_Control>` nodes), ensuring that the node only receives the events that were meant for it.
  22. To keep track of the scene hierarchy (especially when instantiating scenes into other scenes), an "owner" can be set for the node with the :ref:`owner<class_Node_property_owner>` property. This keeps track of who instantiated what. This is mostly useful when writing editors and tools, though.
  23. Finally, when a node is freed with :ref:`Object.free<class_Object_method_free>` or :ref:`queue_free<class_Node_method_queue_free>`, it will also free all its children.
  24. \ **Groups:** Nodes can be added to as many groups as you want to be easy to manage, you could create groups like "enemies" or "collectables" for example, depending on your game. See :ref:`add_to_group<class_Node_method_add_to_group>`, :ref:`is_in_group<class_Node_method_is_in_group>` and :ref:`remove_from_group<class_Node_method_remove_from_group>`. You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on :ref:`SceneTree<class_SceneTree>`.
  25. \ **Networking with nodes:** After connecting to a server (or making one, see :ref:`ENetMultiplayerPeer<class_ENetMultiplayerPeer>`), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling :ref:`rpc<class_Node_method_rpc>` with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its :ref:`NodePath<class_NodePath>` (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos.
  26. \ **Note:** The ``script`` property is part of the :ref:`Object<class_Object>` class, not **Node**. It isn't exposed like most properties but does have a setter and getter (see :ref:`Object.set_script<class_Object_method_set_script>` and :ref:`Object.get_script<class_Object_method_get_script>`).
  27. .. rst-class:: classref-introduction-group
  28. Tutorials
  29. ---------
  30. - :doc:`Nodes and scenes <../getting_started/step_by_step/nodes_and_scenes>`
  31. - `All Demos <https://github.com/godotengine/godot-demo-projects/>`__
  32. .. rst-class:: classref-reftable-group
  33. Properties
  34. ----------
  35. .. table::
  36. :widths: auto
  37. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  38. | :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` | :ref:`auto_translate_mode<class_Node_property_auto_translate_mode>` | ``0`` |
  39. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  40. | :ref:`String<class_String>` | :ref:`editor_description<class_Node_property_editor_description>` | ``""`` |
  41. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  42. | :ref:`MultiplayerAPI<class_MultiplayerAPI>` | :ref:`multiplayer<class_Node_property_multiplayer>` | |
  43. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  44. | :ref:`StringName<class_StringName>` | :ref:`name<class_Node_property_name>` | |
  45. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  46. | :ref:`Node<class_Node>` | :ref:`owner<class_Node_property_owner>` | |
  47. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  48. | :ref:`ProcessMode<enum_Node_ProcessMode>` | :ref:`process_mode<class_Node_property_process_mode>` | ``0`` |
  49. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  50. | :ref:`int<class_int>` | :ref:`process_physics_priority<class_Node_property_process_physics_priority>` | ``0`` |
  51. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  52. | :ref:`int<class_int>` | :ref:`process_priority<class_Node_property_process_priority>` | ``0`` |
  53. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  54. | :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` | :ref:`process_thread_group<class_Node_property_process_thread_group>` | ``0`` |
  55. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  56. | :ref:`int<class_int>` | :ref:`process_thread_group_order<class_Node_property_process_thread_group_order>` | |
  57. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  58. | |bitfield|\[:ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>`\] | :ref:`process_thread_messages<class_Node_property_process_thread_messages>` | |
  59. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  60. | :ref:`String<class_String>` | :ref:`scene_file_path<class_Node_property_scene_file_path>` | |
  61. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  62. | :ref:`bool<class_bool>` | :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>` | ``false`` |
  63. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  64. .. rst-class:: classref-reftable-group
  65. Methods
  66. -------
  67. .. table::
  68. :widths: auto
  69. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | |void| | :ref:`_enter_tree<class_Node_private_method__enter_tree>`\ (\ ) |virtual| |
  71. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | |void| | :ref:`_exit_tree<class_Node_private_method__exit_tree>`\ (\ ) |virtual| |
  73. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_configuration_warnings<class_Node_private_method__get_configuration_warnings>`\ (\ ) |virtual| |const| |
  75. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | |void| | :ref:`_input<class_Node_private_method__input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| |
  77. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | |void| | :ref:`_physics_process<class_Node_private_method__physics_process>`\ (\ delta\: :ref:`float<class_float>`\ ) |virtual| |
  79. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | |void| | :ref:`_process<class_Node_private_method__process>`\ (\ delta\: :ref:`float<class_float>`\ ) |virtual| |
  81. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | |void| | :ref:`_ready<class_Node_private_method__ready>`\ (\ ) |virtual| |
  83. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | |void| | :ref:`_shortcut_input<class_Node_private_method__shortcut_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| |
  85. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | |void| | :ref:`_unhandled_input<class_Node_private_method__unhandled_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| |
  87. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | |void| | :ref:`_unhandled_key_input<class_Node_private_method__unhandled_key_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| |
  89. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | |void| | :ref:`add_child<class_Node_method_add_child>`\ (\ node\: :ref:`Node<class_Node>`, force_readable_name\: :ref:`bool<class_bool>` = false, internal\: :ref:`InternalMode<enum_Node_InternalMode>` = 0\ ) |
  91. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | |void| | :ref:`add_sibling<class_Node_method_add_sibling>`\ (\ sibling\: :ref:`Node<class_Node>`, force_readable_name\: :ref:`bool<class_bool>` = false\ ) |
  93. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | |void| | :ref:`add_to_group<class_Node_method_add_to_group>`\ (\ group\: :ref:`StringName<class_StringName>`, persistent\: :ref:`bool<class_bool>` = false\ ) |
  95. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`String<class_String>` | :ref:`atr<class_Node_method_atr>`\ (\ message\: :ref:`String<class_String>`, context\: :ref:`StringName<class_StringName>` = ""\ ) |const| |
  97. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`String<class_String>` | :ref:`atr_n<class_Node_method_atr_n>`\ (\ message\: :ref:`String<class_String>`, plural_message\: :ref:`StringName<class_StringName>`, n\: :ref:`int<class_int>`, context\: :ref:`StringName<class_StringName>` = ""\ ) |const| |
  99. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Variant<class_Variant>` | :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>`\ (\ method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| |
  101. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`Variant<class_Variant>` | :ref:`call_thread_safe<class_Node_method_call_thread_safe>`\ (\ method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| |
  103. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`bool<class_bool>` | :ref:`can_process<class_Node_method_can_process>`\ (\ ) |const| |
  105. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`Tween<class_Tween>` | :ref:`create_tween<class_Node_method_create_tween>`\ (\ ) |
  107. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Node<class_Node>` | :ref:`duplicate<class_Node_method_duplicate>`\ (\ flags\: :ref:`int<class_int>` = 15\ ) |const| |
  109. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`Node<class_Node>` | :ref:`find_child<class_Node_method_find_child>`\ (\ pattern\: :ref:`String<class_String>`, recursive\: :ref:`bool<class_bool>` = true, owned\: :ref:`bool<class_bool>` = true\ ) |const| |
  111. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`find_children<class_Node_method_find_children>`\ (\ pattern\: :ref:`String<class_String>`, type\: :ref:`String<class_String>` = "", recursive\: :ref:`bool<class_bool>` = true, owned\: :ref:`bool<class_bool>` = true\ ) |const| |
  113. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`Node<class_Node>` | :ref:`find_parent<class_Node_method_find_parent>`\ (\ pattern\: :ref:`String<class_String>`\ ) |const| |
  115. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`Node<class_Node>` | :ref:`get_child<class_Node_method_get_child>`\ (\ idx\: :ref:`int<class_int>`, include_internal\: :ref:`bool<class_bool>` = false\ ) |const| |
  117. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`int<class_int>` | :ref:`get_child_count<class_Node_method_get_child_count>`\ (\ include_internal\: :ref:`bool<class_bool>` = false\ ) |const| |
  119. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_children<class_Node_method_get_children>`\ (\ include_internal\: :ref:`bool<class_bool>` = false\ ) |const| |
  121. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] | :ref:`get_groups<class_Node_method_get_groups>`\ (\ ) |const| |
  123. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`int<class_int>` | :ref:`get_index<class_Node_method_get_index>`\ (\ include_internal\: :ref:`bool<class_bool>` = false\ ) |const| |
  125. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`Window<class_Window>` | :ref:`get_last_exclusive_window<class_Node_method_get_last_exclusive_window>`\ (\ ) |const| |
  127. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`int<class_int>` | :ref:`get_multiplayer_authority<class_Node_method_get_multiplayer_authority>`\ (\ ) |const| |
  129. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Node<class_Node>` | :ref:`get_node<class_Node_method_get_node>`\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |const| |
  131. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`Array<class_Array>` | :ref:`get_node_and_resource<class_Node_method_get_node_and_resource>`\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |
  133. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`Node<class_Node>` | :ref:`get_node_or_null<class_Node_method_get_node_or_null>`\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |const| |
  135. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`Node<class_Node>` | :ref:`get_parent<class_Node_method_get_parent>`\ (\ ) |const| |
  137. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | :ref:`NodePath<class_NodePath>` | :ref:`get_path<class_Node_method_get_path>`\ (\ ) |const| |
  139. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`NodePath<class_NodePath>` | :ref:`get_path_to<class_Node_method_get_path_to>`\ (\ node\: :ref:`Node<class_Node>`, use_unique_path\: :ref:`bool<class_bool>` = false\ ) |const| |
  141. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | :ref:`float<class_float>` | :ref:`get_physics_process_delta_time<class_Node_method_get_physics_process_delta_time>`\ (\ ) |const| |
  143. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`float<class_float>` | :ref:`get_process_delta_time<class_Node_method_get_process_delta_time>`\ (\ ) |const| |
  145. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`bool<class_bool>` | :ref:`get_scene_instance_load_placeholder<class_Node_method_get_scene_instance_load_placeholder>`\ (\ ) |const| |
  147. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`SceneTree<class_SceneTree>` | :ref:`get_tree<class_Node_method_get_tree>`\ (\ ) |const| |
  149. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`String<class_String>` | :ref:`get_tree_string<class_Node_method_get_tree_string>`\ (\ ) |
  151. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | :ref:`String<class_String>` | :ref:`get_tree_string_pretty<class_Node_method_get_tree_string_pretty>`\ (\ ) |
  153. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`Viewport<class_Viewport>` | :ref:`get_viewport<class_Node_method_get_viewport>`\ (\ ) |const| |
  155. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`Window<class_Window>` | :ref:`get_window<class_Node_method_get_window>`\ (\ ) |const| |
  157. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`bool<class_bool>` | :ref:`has_node<class_Node_method_has_node>`\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |const| |
  159. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`bool<class_bool>` | :ref:`has_node_and_resource<class_Node_method_has_node_and_resource>`\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |const| |
  161. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`is_ancestor_of<class_Node_method_is_ancestor_of>`\ (\ node\: :ref:`Node<class_Node>`\ ) |const| |
  163. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`bool<class_bool>` | :ref:`is_displayed_folded<class_Node_method_is_displayed_folded>`\ (\ ) |const| |
  165. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`bool<class_bool>` | :ref:`is_editable_instance<class_Node_method_is_editable_instance>`\ (\ node\: :ref:`Node<class_Node>`\ ) |const| |
  167. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`bool<class_bool>` | :ref:`is_greater_than<class_Node_method_is_greater_than>`\ (\ node\: :ref:`Node<class_Node>`\ ) |const| |
  169. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`bool<class_bool>` | :ref:`is_in_group<class_Node_method_is_in_group>`\ (\ group\: :ref:`StringName<class_StringName>`\ ) |const| |
  171. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`bool<class_bool>` | :ref:`is_inside_tree<class_Node_method_is_inside_tree>`\ (\ ) |const| |
  173. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`bool<class_bool>` | :ref:`is_multiplayer_authority<class_Node_method_is_multiplayer_authority>`\ (\ ) |const| |
  175. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :ref:`bool<class_bool>` | :ref:`is_node_ready<class_Node_method_is_node_ready>`\ (\ ) |const| |
  177. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`bool<class_bool>` | :ref:`is_physics_processing<class_Node_method_is_physics_processing>`\ (\ ) |const| |
  179. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`bool<class_bool>` | :ref:`is_physics_processing_internal<class_Node_method_is_physics_processing_internal>`\ (\ ) |const| |
  181. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`bool<class_bool>` | :ref:`is_processing<class_Node_method_is_processing>`\ (\ ) |const| |
  183. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`bool<class_bool>` | :ref:`is_processing_input<class_Node_method_is_processing_input>`\ (\ ) |const| |
  185. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | :ref:`bool<class_bool>` | :ref:`is_processing_internal<class_Node_method_is_processing_internal>`\ (\ ) |const| |
  187. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | :ref:`bool<class_bool>` | :ref:`is_processing_shortcut_input<class_Node_method_is_processing_shortcut_input>`\ (\ ) |const| |
  189. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`bool<class_bool>` | :ref:`is_processing_unhandled_input<class_Node_method_is_processing_unhandled_input>`\ (\ ) |const| |
  191. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`bool<class_bool>` | :ref:`is_processing_unhandled_key_input<class_Node_method_is_processing_unhandled_key_input>`\ (\ ) |const| |
  193. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | |void| | :ref:`move_child<class_Node_method_move_child>`\ (\ child_node\: :ref:`Node<class_Node>`, to_index\: :ref:`int<class_int>`\ ) |
  195. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | |void| | :ref:`notify_deferred_thread_group<class_Node_method_notify_deferred_thread_group>`\ (\ what\: :ref:`int<class_int>`\ ) |
  197. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | |void| | :ref:`notify_thread_safe<class_Node_method_notify_thread_safe>`\ (\ what\: :ref:`int<class_int>`\ ) |
  199. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | |void| | :ref:`print_orphan_nodes<class_Node_method_print_orphan_nodes>`\ (\ ) |static| |
  201. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | |void| | :ref:`print_tree<class_Node_method_print_tree>`\ (\ ) |
  203. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | |void| | :ref:`print_tree_pretty<class_Node_method_print_tree_pretty>`\ (\ ) |
  205. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | |void| | :ref:`propagate_call<class_Node_method_propagate_call>`\ (\ method\: :ref:`StringName<class_StringName>`, args\: :ref:`Array<class_Array>` = [], parent_first\: :ref:`bool<class_bool>` = false\ ) |
  207. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | |void| | :ref:`propagate_notification<class_Node_method_propagate_notification>`\ (\ what\: :ref:`int<class_int>`\ ) |
  209. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | |void| | :ref:`queue_free<class_Node_method_queue_free>`\ (\ ) |
  211. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | |void| | :ref:`remove_child<class_Node_method_remove_child>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
  213. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | |void| | :ref:`remove_from_group<class_Node_method_remove_from_group>`\ (\ group\: :ref:`StringName<class_StringName>`\ ) |
  215. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | |void| | :ref:`reparent<class_Node_method_reparent>`\ (\ new_parent\: :ref:`Node<class_Node>`, keep_global_transform\: :ref:`bool<class_bool>` = true\ ) |
  217. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | |void| | :ref:`replace_by<class_Node_method_replace_by>`\ (\ node\: :ref:`Node<class_Node>`, keep_groups\: :ref:`bool<class_bool>` = false\ ) |
  219. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | |void| | :ref:`request_ready<class_Node_method_request_ready>`\ (\ ) |
  221. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`rpc<class_Node_method_rpc>`\ (\ method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| |
  223. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | |void| | :ref:`rpc_config<class_Node_method_rpc_config>`\ (\ method\: :ref:`StringName<class_StringName>`, config\: :ref:`Variant<class_Variant>`\ ) |
  225. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`rpc_id<class_Node_method_rpc_id>`\ (\ peer_id\: :ref:`int<class_int>`, method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| |
  227. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | |void| | :ref:`set_deferred_thread_group<class_Node_method_set_deferred_thread_group>`\ (\ property\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) |
  229. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | |void| | :ref:`set_display_folded<class_Node_method_set_display_folded>`\ (\ fold\: :ref:`bool<class_bool>`\ ) |
  231. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | |void| | :ref:`set_editable_instance<class_Node_method_set_editable_instance>`\ (\ node\: :ref:`Node<class_Node>`, is_editable\: :ref:`bool<class_bool>`\ ) |
  233. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | |void| | :ref:`set_multiplayer_authority<class_Node_method_set_multiplayer_authority>`\ (\ id\: :ref:`int<class_int>`, recursive\: :ref:`bool<class_bool>` = true\ ) |
  235. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | |void| | :ref:`set_physics_process<class_Node_method_set_physics_process>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  237. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | |void| | :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  239. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | |void| | :ref:`set_process<class_Node_method_set_process>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  241. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | |void| | :ref:`set_process_input<class_Node_method_set_process_input>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  243. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | |void| | :ref:`set_process_internal<class_Node_method_set_process_internal>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  245. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | |void| | :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  247. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | |void| | :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  249. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | |void| | :ref:`set_process_unhandled_key_input<class_Node_method_set_process_unhandled_key_input>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  251. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | |void| | :ref:`set_scene_instance_load_placeholder<class_Node_method_set_scene_instance_load_placeholder>`\ (\ load_placeholder\: :ref:`bool<class_bool>`\ ) |
  253. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | |void| | :ref:`set_thread_safe<class_Node_method_set_thread_safe>`\ (\ property\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) |
  255. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | |void| | :ref:`update_configuration_warnings<class_Node_method_update_configuration_warnings>`\ (\ ) |
  257. +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. .. rst-class:: classref-section-separator
  259. ----
  260. .. rst-class:: classref-descriptions-group
  261. Signals
  262. -------
  263. .. _class_Node_signal_child_entered_tree:
  264. .. rst-class:: classref-signal
  265. **child_entered_tree**\ (\ node\: :ref:`Node<class_Node>`\ )
  266. Emitted when the child ``node`` enters the :ref:`SceneTree<class_SceneTree>`, usually because this node entered the tree (see :ref:`tree_entered<class_Node_signal_tree_entered>`), or :ref:`add_child<class_Node_method_add_child>` has been called.
  267. This signal is emitted *after* the child node's own :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` and :ref:`tree_entered<class_Node_signal_tree_entered>`.
  268. .. rst-class:: classref-item-separator
  269. ----
  270. .. _class_Node_signal_child_exiting_tree:
  271. .. rst-class:: classref-signal
  272. **child_exiting_tree**\ (\ node\: :ref:`Node<class_Node>`\ )
  273. Emitted when the child ``node`` is about to exit the :ref:`SceneTree<class_SceneTree>`, usually because this node is exiting the tree (see :ref:`tree_exiting<class_Node_signal_tree_exiting>`), or because the child ``node`` is being removed or freed.
  274. When this signal is received, the child ``node`` is still accessible inside the tree. This signal is emitted *after* the child node's own :ref:`tree_exiting<class_Node_signal_tree_exiting>` and :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>`.
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_Node_signal_child_order_changed:
  278. .. rst-class:: classref-signal
  279. **child_order_changed**\ (\ )
  280. Emitted when the list of children is changed. This happens when child nodes are added, moved or removed.
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_Node_signal_editor_description_changed:
  284. .. rst-class:: classref-signal
  285. **editor_description_changed**\ (\ node\: :ref:`Node<class_Node>`\ )
  286. Emitted when the node's editor description field changed.
  287. .. rst-class:: classref-item-separator
  288. ----
  289. .. _class_Node_signal_ready:
  290. .. rst-class:: classref-signal
  291. **ready**\ (\ )
  292. Emitted when the node is considered ready, after :ref:`_ready<class_Node_private_method__ready>` is called.
  293. .. rst-class:: classref-item-separator
  294. ----
  295. .. _class_Node_signal_renamed:
  296. .. rst-class:: classref-signal
  297. **renamed**\ (\ )
  298. Emitted when the node's :ref:`name<class_Node_property_name>` is changed, if the node is inside the tree.
  299. .. rst-class:: classref-item-separator
  300. ----
  301. .. _class_Node_signal_replacing_by:
  302. .. rst-class:: classref-signal
  303. **replacing_by**\ (\ node\: :ref:`Node<class_Node>`\ )
  304. Emitted when this node is being replaced by the ``node``, see :ref:`replace_by<class_Node_method_replace_by>`.
  305. This signal is emitted *after* ``node`` has been added as a child of the original parent node, but *before* all original child nodes have been reparented to ``node``.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_Node_signal_tree_entered:
  309. .. rst-class:: classref-signal
  310. **tree_entered**\ (\ )
  311. Emitted when the node enters the tree.
  312. This signal is emitted *after* the related :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification.
  313. .. rst-class:: classref-item-separator
  314. ----
  315. .. _class_Node_signal_tree_exited:
  316. .. rst-class:: classref-signal
  317. **tree_exited**\ (\ )
  318. Emitted after the node exits the tree and is no longer active.
  319. This signal is emitted *after* the related :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>` notification.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_Node_signal_tree_exiting:
  323. .. rst-class:: classref-signal
  324. **tree_exiting**\ (\ )
  325. Emitted when the node is just about to exit the tree. The node is still valid. As such, this is the right place for de-initialization (or a "destructor", if you will).
  326. This signal is emitted *after* the node's :ref:`_exit_tree<class_Node_private_method__exit_tree>`, and *before* the related :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>`.
  327. .. rst-class:: classref-section-separator
  328. ----
  329. .. rst-class:: classref-descriptions-group
  330. Enumerations
  331. ------------
  332. .. _enum_Node_ProcessMode:
  333. .. rst-class:: classref-enumeration
  334. enum **ProcessMode**:
  335. .. _class_Node_constant_PROCESS_MODE_INHERIT:
  336. .. rst-class:: classref-enumeration-constant
  337. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_INHERIT** = ``0``
  338. Inherits :ref:`process_mode<class_Node_property_process_mode>` from the node's parent. This is the default for any newly created node.
  339. .. _class_Node_constant_PROCESS_MODE_PAUSABLE:
  340. .. rst-class:: classref-enumeration-constant
  341. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_PAUSABLE** = ``1``
  342. Stops processing when :ref:`SceneTree.paused<class_SceneTree_property_paused>` is ``true``. This is the inverse of :ref:`PROCESS_MODE_WHEN_PAUSED<class_Node_constant_PROCESS_MODE_WHEN_PAUSED>`, and the default for the root node.
  343. .. _class_Node_constant_PROCESS_MODE_WHEN_PAUSED:
  344. .. rst-class:: classref-enumeration-constant
  345. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_WHEN_PAUSED** = ``2``
  346. Process **only** when :ref:`SceneTree.paused<class_SceneTree_property_paused>` is ``true``. This is the inverse of :ref:`PROCESS_MODE_PAUSABLE<class_Node_constant_PROCESS_MODE_PAUSABLE>`.
  347. .. _class_Node_constant_PROCESS_MODE_ALWAYS:
  348. .. rst-class:: classref-enumeration-constant
  349. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_ALWAYS** = ``3``
  350. Always process. Keeps processing, ignoring :ref:`SceneTree.paused<class_SceneTree_property_paused>`. This is the inverse of :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  351. .. _class_Node_constant_PROCESS_MODE_DISABLED:
  352. .. rst-class:: classref-enumeration-constant
  353. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_DISABLED** = ``4``
  354. Never process. Completely disables processing, ignoring :ref:`SceneTree.paused<class_SceneTree_property_paused>`. This is the inverse of :ref:`PROCESS_MODE_ALWAYS<class_Node_constant_PROCESS_MODE_ALWAYS>`.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _enum_Node_ProcessThreadGroup:
  358. .. rst-class:: classref-enumeration
  359. enum **ProcessThreadGroup**:
  360. .. _class_Node_constant_PROCESS_THREAD_GROUP_INHERIT:
  361. .. rst-class:: classref-enumeration-constant
  362. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_INHERIT** = ``0``
  363. Process this node based on the thread group mode of the first parent (or grandparent) node that has a thread group mode that is not inherit. See :ref:`process_thread_group<class_Node_property_process_thread_group>` for more information.
  364. .. _class_Node_constant_PROCESS_THREAD_GROUP_MAIN_THREAD:
  365. .. rst-class:: classref-enumeration-constant
  366. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_MAIN_THREAD** = ``1``
  367. Process this node (and child nodes set to inherit) on the main thread. See :ref:`process_thread_group<class_Node_property_process_thread_group>` for more information.
  368. .. _class_Node_constant_PROCESS_THREAD_GROUP_SUB_THREAD:
  369. .. rst-class:: classref-enumeration-constant
  370. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_SUB_THREAD** = ``2``
  371. Process this node (and child nodes set to inherit) on a sub-thread. See :ref:`process_thread_group<class_Node_property_process_thread_group>` for more information.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _enum_Node_ProcessThreadMessages:
  375. .. rst-class:: classref-enumeration
  376. flags **ProcessThreadMessages**:
  377. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES:
  378. .. rst-class:: classref-enumeration-constant
  379. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES** = ``1``
  380. Allows this node to process threaded messages created with :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>` right before :ref:`_process<class_Node_private_method__process>` is called.
  381. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES_PHYSICS:
  382. .. rst-class:: classref-enumeration-constant
  383. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES_PHYSICS** = ``2``
  384. Allows this node to process threaded messages created with :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>` right before :ref:`_physics_process<class_Node_private_method__physics_process>` is called.
  385. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES_ALL:
  386. .. rst-class:: classref-enumeration-constant
  387. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES_ALL** = ``3``
  388. Allows this node to process threaded messages created with :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>` right before either :ref:`_process<class_Node_private_method__process>` or :ref:`_physics_process<class_Node_private_method__physics_process>` are called.
  389. .. rst-class:: classref-item-separator
  390. ----
  391. .. _enum_Node_DuplicateFlags:
  392. .. rst-class:: classref-enumeration
  393. enum **DuplicateFlags**:
  394. .. _class_Node_constant_DUPLICATE_SIGNALS:
  395. .. rst-class:: classref-enumeration-constant
  396. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SIGNALS** = ``1``
  397. Duplicate the node's signal connections.
  398. .. _class_Node_constant_DUPLICATE_GROUPS:
  399. .. rst-class:: classref-enumeration-constant
  400. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_GROUPS** = ``2``
  401. Duplicate the node's groups.
  402. .. _class_Node_constant_DUPLICATE_SCRIPTS:
  403. .. rst-class:: classref-enumeration-constant
  404. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SCRIPTS** = ``4``
  405. Duplicate the node's script (also overriding the duplicated children's scripts, if combined with :ref:`DUPLICATE_USE_INSTANTIATION<class_Node_constant_DUPLICATE_USE_INSTANTIATION>`).
  406. .. _class_Node_constant_DUPLICATE_USE_INSTANTIATION:
  407. .. rst-class:: classref-enumeration-constant
  408. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_USE_INSTANTIATION** = ``8``
  409. Duplicate using :ref:`PackedScene.instantiate<class_PackedScene_method_instantiate>`. If the node comes from a scene saved on disk, re-uses :ref:`PackedScene.instantiate<class_PackedScene_method_instantiate>` as the base for the duplicated node and its children.
  410. .. rst-class:: classref-item-separator
  411. ----
  412. .. _enum_Node_InternalMode:
  413. .. rst-class:: classref-enumeration
  414. enum **InternalMode**:
  415. .. _class_Node_constant_INTERNAL_MODE_DISABLED:
  416. .. rst-class:: classref-enumeration-constant
  417. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_DISABLED** = ``0``
  418. The node will not be internal.
  419. .. _class_Node_constant_INTERNAL_MODE_FRONT:
  420. .. rst-class:: classref-enumeration-constant
  421. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_FRONT** = ``1``
  422. The node will be placed at the beginning of the parent's children, before any non-internal sibling.
  423. .. _class_Node_constant_INTERNAL_MODE_BACK:
  424. .. rst-class:: classref-enumeration-constant
  425. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_BACK** = ``2``
  426. The node will be placed at the end of the parent's children, after any non-internal sibling.
  427. .. rst-class:: classref-item-separator
  428. ----
  429. .. _enum_Node_AutoTranslateMode:
  430. .. rst-class:: classref-enumeration
  431. enum **AutoTranslateMode**:
  432. .. _class_Node_constant_AUTO_TRANSLATE_MODE_INHERIT:
  433. .. rst-class:: classref-enumeration-constant
  434. :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **AUTO_TRANSLATE_MODE_INHERIT** = ``0``
  435. Inherits :ref:`auto_translate_mode<class_Node_property_auto_translate_mode>` from the node's parent. This is the default for any newly created node.
  436. .. _class_Node_constant_AUTO_TRANSLATE_MODE_ALWAYS:
  437. .. rst-class:: classref-enumeration-constant
  438. :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **AUTO_TRANSLATE_MODE_ALWAYS** = ``1``
  439. Always automatically translate. This is the inverse of :ref:`AUTO_TRANSLATE_MODE_DISABLED<class_Node_constant_AUTO_TRANSLATE_MODE_DISABLED>`, and the default for the root node.
  440. .. _class_Node_constant_AUTO_TRANSLATE_MODE_DISABLED:
  441. .. rst-class:: classref-enumeration-constant
  442. :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **AUTO_TRANSLATE_MODE_DISABLED** = ``2``
  443. Never automatically translate. This is the inverse of :ref:`AUTO_TRANSLATE_MODE_ALWAYS<class_Node_constant_AUTO_TRANSLATE_MODE_ALWAYS>`.
  444. String parsing for POT generation will be skipped for this node and children that are set to :ref:`AUTO_TRANSLATE_MODE_INHERIT<class_Node_constant_AUTO_TRANSLATE_MODE_INHERIT>`.
  445. .. rst-class:: classref-section-separator
  446. ----
  447. .. rst-class:: classref-descriptions-group
  448. Constants
  449. ---------
  450. .. _class_Node_constant_NOTIFICATION_ENTER_TREE:
  451. .. rst-class:: classref-constant
  452. **NOTIFICATION_ENTER_TREE** = ``10``
  453. Notification received when the node enters a :ref:`SceneTree<class_SceneTree>`. See :ref:`_enter_tree<class_Node_private_method__enter_tree>`.
  454. This notification is received *before* the related :ref:`tree_entered<class_Node_signal_tree_entered>` signal.
  455. .. _class_Node_constant_NOTIFICATION_EXIT_TREE:
  456. .. rst-class:: classref-constant
  457. **NOTIFICATION_EXIT_TREE** = ``11``
  458. Notification received when the node is about to exit a :ref:`SceneTree<class_SceneTree>`. See :ref:`_exit_tree<class_Node_private_method__exit_tree>`.
  459. This notification is received *after* the related :ref:`tree_exiting<class_Node_signal_tree_exiting>` signal.
  460. .. _class_Node_constant_NOTIFICATION_MOVED_IN_PARENT:
  461. .. rst-class:: classref-constant
  462. **NOTIFICATION_MOVED_IN_PARENT** = ``12``
  463. **Deprecated:** This notification is no longer sent by the engine. Use :ref:`NOTIFICATION_CHILD_ORDER_CHANGED<class_Node_constant_NOTIFICATION_CHILD_ORDER_CHANGED>` instead.
  464. .. _class_Node_constant_NOTIFICATION_READY:
  465. .. rst-class:: classref-constant
  466. **NOTIFICATION_READY** = ``13``
  467. Notification received when the node is ready. See :ref:`_ready<class_Node_private_method__ready>`.
  468. .. _class_Node_constant_NOTIFICATION_PAUSED:
  469. .. rst-class:: classref-constant
  470. **NOTIFICATION_PAUSED** = ``14``
  471. Notification received when the node is paused. See :ref:`process_mode<class_Node_property_process_mode>`.
  472. .. _class_Node_constant_NOTIFICATION_UNPAUSED:
  473. .. rst-class:: classref-constant
  474. **NOTIFICATION_UNPAUSED** = ``15``
  475. Notification received when the node is unpaused. See :ref:`process_mode<class_Node_property_process_mode>`.
  476. .. _class_Node_constant_NOTIFICATION_PHYSICS_PROCESS:
  477. .. rst-class:: classref-constant
  478. **NOTIFICATION_PHYSICS_PROCESS** = ``16``
  479. Notification received from the tree every physics frame when :ref:`is_physics_processing<class_Node_method_is_physics_processing>` returns ``true``. See :ref:`_physics_process<class_Node_private_method__physics_process>`.
  480. .. _class_Node_constant_NOTIFICATION_PROCESS:
  481. .. rst-class:: classref-constant
  482. **NOTIFICATION_PROCESS** = ``17``
  483. Notification received from the tree every rendered frame when :ref:`is_processing<class_Node_method_is_processing>` returns ``true``. See :ref:`_process<class_Node_private_method__process>`.
  484. .. _class_Node_constant_NOTIFICATION_PARENTED:
  485. .. rst-class:: classref-constant
  486. **NOTIFICATION_PARENTED** = ``18``
  487. Notification received when the node is set as a child of another node (see :ref:`add_child<class_Node_method_add_child>` and :ref:`add_sibling<class_Node_method_add_sibling>`).
  488. \ **Note:** This does *not* mean that the node entered the :ref:`SceneTree<class_SceneTree>`.
  489. .. _class_Node_constant_NOTIFICATION_UNPARENTED:
  490. .. rst-class:: classref-constant
  491. **NOTIFICATION_UNPARENTED** = ``19``
  492. Notification received when the parent node calls :ref:`remove_child<class_Node_method_remove_child>` on this node.
  493. \ **Note:** This does *not* mean that the node exited the :ref:`SceneTree<class_SceneTree>`.
  494. .. _class_Node_constant_NOTIFICATION_SCENE_INSTANTIATED:
  495. .. rst-class:: classref-constant
  496. **NOTIFICATION_SCENE_INSTANTIATED** = ``20``
  497. Notification received *only* by the newly instantiated scene root node, when :ref:`PackedScene.instantiate<class_PackedScene_method_instantiate>` is completed.
  498. .. _class_Node_constant_NOTIFICATION_DRAG_BEGIN:
  499. .. rst-class:: classref-constant
  500. **NOTIFICATION_DRAG_BEGIN** = ``21``
  501. Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one.
  502. Can be triggered either by dragging a :ref:`Control<class_Control>` that provides drag data (see :ref:`Control._get_drag_data<class_Control_private_method__get_drag_data>`) or using :ref:`Control.force_drag<class_Control_method_force_drag>`.
  503. Use :ref:`Viewport.gui_get_drag_data<class_Viewport_method_gui_get_drag_data>` to get the dragged data.
  504. .. _class_Node_constant_NOTIFICATION_DRAG_END:
  505. .. rst-class:: classref-constant
  506. **NOTIFICATION_DRAG_END** = ``22``
  507. Notification received when a drag operation ends.
  508. Use :ref:`Viewport.gui_is_drag_successful<class_Viewport_method_gui_is_drag_successful>` to check if the drag succeeded.
  509. .. _class_Node_constant_NOTIFICATION_PATH_RENAMED:
  510. .. rst-class:: classref-constant
  511. **NOTIFICATION_PATH_RENAMED** = ``23``
  512. Notification received when the node's :ref:`name<class_Node_property_name>` or one of its ancestors' :ref:`name<class_Node_property_name>` is changed. This notification is *not* received when the node is removed from the :ref:`SceneTree<class_SceneTree>`.
  513. .. _class_Node_constant_NOTIFICATION_CHILD_ORDER_CHANGED:
  514. .. rst-class:: classref-constant
  515. **NOTIFICATION_CHILD_ORDER_CHANGED** = ``24``
  516. Notification received when the list of children is changed. This happens when child nodes are added, moved or removed.
  517. .. _class_Node_constant_NOTIFICATION_INTERNAL_PROCESS:
  518. .. rst-class:: classref-constant
  519. **NOTIFICATION_INTERNAL_PROCESS** = ``25``
  520. Notification received from the tree every rendered frame when :ref:`is_processing_internal<class_Node_method_is_processing_internal>` returns ``true``.
  521. .. _class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS:
  522. .. rst-class:: classref-constant
  523. **NOTIFICATION_INTERNAL_PHYSICS_PROCESS** = ``26``
  524. Notification received from the tree every physics frame when :ref:`is_physics_processing_internal<class_Node_method_is_physics_processing_internal>` returns ``true``.
  525. .. _class_Node_constant_NOTIFICATION_POST_ENTER_TREE:
  526. .. rst-class:: classref-constant
  527. **NOTIFICATION_POST_ENTER_TREE** = ``27``
  528. Notification received when the node enters the tree, just before :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` may be received. Unlike the latter, it is sent every time the node enters tree, not just once.
  529. .. _class_Node_constant_NOTIFICATION_DISABLED:
  530. .. rst-class:: classref-constant
  531. **NOTIFICATION_DISABLED** = ``28``
  532. Notification received when the node is disabled. See :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  533. .. _class_Node_constant_NOTIFICATION_ENABLED:
  534. .. rst-class:: classref-constant
  535. **NOTIFICATION_ENABLED** = ``29``
  536. Notification received when the node is enabled again after being disabled. See :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  537. .. _class_Node_constant_NOTIFICATION_EDITOR_PRE_SAVE:
  538. .. rst-class:: classref-constant
  539. **NOTIFICATION_EDITOR_PRE_SAVE** = ``9001``
  540. Notification received right before the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects.
  541. .. _class_Node_constant_NOTIFICATION_EDITOR_POST_SAVE:
  542. .. rst-class:: classref-constant
  543. **NOTIFICATION_EDITOR_POST_SAVE** = ``9002``
  544. Notification received right after the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects.
  545. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_ENTER:
  546. .. rst-class:: classref-constant
  547. **NOTIFICATION_WM_MOUSE_ENTER** = ``1002``
  548. Notification received when the mouse enters the window.
  549. Implemented for embedded windows and on desktop and web platforms.
  550. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_EXIT:
  551. .. rst-class:: classref-constant
  552. **NOTIFICATION_WM_MOUSE_EXIT** = ``1003``
  553. Notification received when the mouse leaves the window.
  554. Implemented for embedded windows and on desktop and web platforms.
  555. .. _class_Node_constant_NOTIFICATION_WM_WINDOW_FOCUS_IN:
  556. .. rst-class:: classref-constant
  557. **NOTIFICATION_WM_WINDOW_FOCUS_IN** = ``1004``
  558. Notification received from the OS when the node's :ref:`Window<class_Window>` ancestor is focused. This may be a change of focus between two windows of the same engine instance, or from the OS desktop or a third-party application to a window of the game (in which case :ref:`NOTIFICATION_APPLICATION_FOCUS_IN<class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_IN>` is also received).
  559. A :ref:`Window<class_Window>` node receives this notification when it is focused.
  560. .. _class_Node_constant_NOTIFICATION_WM_WINDOW_FOCUS_OUT:
  561. .. rst-class:: classref-constant
  562. **NOTIFICATION_WM_WINDOW_FOCUS_OUT** = ``1005``
  563. Notification received from the OS when the node's :ref:`Window<class_Window>` ancestor is defocused. This may be a change of focus between two windows of the same engine instance, or from a window of the game to the OS desktop or a third-party application (in which case :ref:`NOTIFICATION_APPLICATION_FOCUS_OUT<class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_OUT>` is also received).
  564. A :ref:`Window<class_Window>` node receives this notification when it is defocused.
  565. .. _class_Node_constant_NOTIFICATION_WM_CLOSE_REQUEST:
  566. .. rst-class:: classref-constant
  567. **NOTIFICATION_WM_CLOSE_REQUEST** = ``1006``
  568. Notification received from the OS when a close request is sent (e.g. closing the window with a "Close" button or :kbd:`Alt + F4`).
  569. Implemented on desktop platforms.
  570. .. _class_Node_constant_NOTIFICATION_WM_GO_BACK_REQUEST:
  571. .. rst-class:: classref-constant
  572. **NOTIFICATION_WM_GO_BACK_REQUEST** = ``1007``
  573. Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
  574. Implemented only on iOS.
  575. .. _class_Node_constant_NOTIFICATION_WM_SIZE_CHANGED:
  576. .. rst-class:: classref-constant
  577. **NOTIFICATION_WM_SIZE_CHANGED** = ``1008``
  578. Notification received when the window is resized.
  579. \ **Note:** Only the resized :ref:`Window<class_Window>` node receives this notification, and it's not propagated to the child nodes.
  580. .. _class_Node_constant_NOTIFICATION_WM_DPI_CHANGE:
  581. .. rst-class:: classref-constant
  582. **NOTIFICATION_WM_DPI_CHANGE** = ``1009``
  583. Notification received from the OS when the screen's dots per inch (DPI) scale is changed. Only implemented on macOS.
  584. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_ENTER:
  585. .. rst-class:: classref-constant
  586. **NOTIFICATION_VP_MOUSE_ENTER** = ``1010``
  587. Notification received when the mouse cursor enters the :ref:`Viewport<class_Viewport>`'s visible area, that is not occluded behind other :ref:`Control<class_Control>`\ s or :ref:`Window<class_Window>`\ s, provided its :ref:`Viewport.gui_disable_input<class_Viewport_property_gui_disable_input>` is ``false`` and regardless if it's currently focused or not.
  588. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_EXIT:
  589. .. rst-class:: classref-constant
  590. **NOTIFICATION_VP_MOUSE_EXIT** = ``1011``
  591. Notification received when the mouse cursor leaves the :ref:`Viewport<class_Viewport>`'s visible area, that is not occluded behind other :ref:`Control<class_Control>`\ s or :ref:`Window<class_Window>`\ s, provided its :ref:`Viewport.gui_disable_input<class_Viewport_property_gui_disable_input>` is ``false`` and regardless if it's currently focused or not.
  592. .. _class_Node_constant_NOTIFICATION_OS_MEMORY_WARNING:
  593. .. rst-class:: classref-constant
  594. **NOTIFICATION_OS_MEMORY_WARNING** = ``2009``
  595. Notification received from the OS when the application is exceeding its allocated memory.
  596. Implemented only on iOS.
  597. .. _class_Node_constant_NOTIFICATION_TRANSLATION_CHANGED:
  598. .. rst-class:: classref-constant
  599. **NOTIFICATION_TRANSLATION_CHANGED** = ``2010``
  600. Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like :ref:`Object.tr<class_Object_method_tr>`.
  601. .. _class_Node_constant_NOTIFICATION_WM_ABOUT:
  602. .. rst-class:: classref-constant
  603. **NOTIFICATION_WM_ABOUT** = ``2011``
  604. Notification received from the OS when a request for "About" information is sent.
  605. Implemented only on macOS.
  606. .. _class_Node_constant_NOTIFICATION_CRASH:
  607. .. rst-class:: classref-constant
  608. **NOTIFICATION_CRASH** = ``2012``
  609. Notification received from Godot's crash handler when the engine is about to crash.
  610. Implemented on desktop platforms, if the crash handler is enabled.
  611. .. _class_Node_constant_NOTIFICATION_OS_IME_UPDATE:
  612. .. rst-class:: classref-constant
  613. **NOTIFICATION_OS_IME_UPDATE** = ``2013``
  614. Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
  615. Implemented only on macOS.
  616. .. _class_Node_constant_NOTIFICATION_APPLICATION_RESUMED:
  617. .. rst-class:: classref-constant
  618. **NOTIFICATION_APPLICATION_RESUMED** = ``2014``
  619. Notification received from the OS when the application is resumed.
  620. Specific to the Android and iOS platforms.
  621. .. _class_Node_constant_NOTIFICATION_APPLICATION_PAUSED:
  622. .. rst-class:: classref-constant
  623. **NOTIFICATION_APPLICATION_PAUSED** = ``2015``
  624. Notification received from the OS when the application is paused.
  625. Specific to the Android and iOS platforms.
  626. \ **Note:** On iOS, you only have approximately 5 seconds to finish a task started by this signal. If you go over this allotment, iOS will kill the app instead of pausing it.
  627. .. _class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_IN:
  628. .. rst-class:: classref-constant
  629. **NOTIFICATION_APPLICATION_FOCUS_IN** = ``2016``
  630. Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance.
  631. Implemented on desktop and mobile platforms.
  632. .. _class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_OUT:
  633. .. rst-class:: classref-constant
  634. **NOTIFICATION_APPLICATION_FOCUS_OUT** = ``2017``
  635. Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
  636. Implemented on desktop and mobile platforms.
  637. .. _class_Node_constant_NOTIFICATION_TEXT_SERVER_CHANGED:
  638. .. rst-class:: classref-constant
  639. **NOTIFICATION_TEXT_SERVER_CHANGED** = ``2018``
  640. Notification received when the :ref:`TextServer<class_TextServer>` is changed.
  641. .. rst-class:: classref-section-separator
  642. ----
  643. .. rst-class:: classref-descriptions-group
  644. Property Descriptions
  645. ---------------------
  646. .. _class_Node_property_auto_translate_mode:
  647. .. rst-class:: classref-property
  648. :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **auto_translate_mode** = ``0``
  649. .. rst-class:: classref-property-setget
  650. - |void| **set_auto_translate_mode**\ (\ value\: :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>`\ )
  651. - :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **get_auto_translate_mode**\ (\ )
  652. Defines if any text should automatically change to its translated version depending on the current locale (for nodes such as :ref:`Label<class_Label>`, :ref:`RichTextLabel<class_RichTextLabel>`, :ref:`Window<class_Window>`, etc.). See :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>`.
  653. Also decides if the node's strings should be parsed for POT generation.
  654. .. rst-class:: classref-item-separator
  655. ----
  656. .. _class_Node_property_editor_description:
  657. .. rst-class:: classref-property
  658. :ref:`String<class_String>` **editor_description** = ``""``
  659. .. rst-class:: classref-property-setget
  660. - |void| **set_editor_description**\ (\ value\: :ref:`String<class_String>`\ )
  661. - :ref:`String<class_String>` **get_editor_description**\ (\ )
  662. An optional description to the node. It will be displayed as a tooltip when hovering over the node in the editor's Scene dock.
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_Node_property_multiplayer:
  666. .. rst-class:: classref-property
  667. :ref:`MultiplayerAPI<class_MultiplayerAPI>` **multiplayer**
  668. .. rst-class:: classref-property-setget
  669. - :ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_multiplayer**\ (\ )
  670. The :ref:`MultiplayerAPI<class_MultiplayerAPI>` instance associated with this node. See :ref:`SceneTree.get_multiplayer<class_SceneTree_method_get_multiplayer>`.
  671. \ **Note:** Renaming the node, or moving it in the tree, will not move the :ref:`MultiplayerAPI<class_MultiplayerAPI>` to the new path, you will have to update this manually.
  672. .. rst-class:: classref-item-separator
  673. ----
  674. .. _class_Node_property_name:
  675. .. rst-class:: classref-property
  676. :ref:`StringName<class_StringName>` **name**
  677. .. rst-class:: classref-property-setget
  678. - |void| **set_name**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  679. - :ref:`StringName<class_StringName>` **get_name**\ (\ )
  680. The name of the node. This name must be unique among the siblings (other child nodes from the same parent). When set to an existing sibling's name, the node is automatically renamed.
  681. \ **Note:** When changing the name, the following characters will be replaced with an underscore: (``.`` ``:`` ``@`` ``/`` ``"`` ``%``). In particular, the ``@`` character is reserved for auto-generated names. See also :ref:`String.validate_node_name<class_String_method_validate_node_name>`.
  682. .. rst-class:: classref-item-separator
  683. ----
  684. .. _class_Node_property_owner:
  685. .. rst-class:: classref-property
  686. :ref:`Node<class_Node>` **owner**
  687. .. rst-class:: classref-property-setget
  688. - |void| **set_owner**\ (\ value\: :ref:`Node<class_Node>`\ )
  689. - :ref:`Node<class_Node>` **get_owner**\ (\ )
  690. The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a :ref:`PackedScene<class_PackedScene>`, all the nodes it owns are also saved with it.
  691. \ **Note:** In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will **not** be saved. To prevent this, remember to set the owner after calling :ref:`add_child<class_Node_method_add_child>`. See also (see :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>`)
  692. .. rst-class:: classref-item-separator
  693. ----
  694. .. _class_Node_property_process_mode:
  695. .. rst-class:: classref-property
  696. :ref:`ProcessMode<enum_Node_ProcessMode>` **process_mode** = ``0``
  697. .. rst-class:: classref-property-setget
  698. - |void| **set_process_mode**\ (\ value\: :ref:`ProcessMode<enum_Node_ProcessMode>`\ )
  699. - :ref:`ProcessMode<enum_Node_ProcessMode>` **get_process_mode**\ (\ )
  700. The node's processing behavior (see :ref:`ProcessMode<enum_Node_ProcessMode>`). To check if the node can process in its current mode, use :ref:`can_process<class_Node_method_can_process>`.
  701. .. rst-class:: classref-item-separator
  702. ----
  703. .. _class_Node_property_process_physics_priority:
  704. .. rst-class:: classref-property
  705. :ref:`int<class_int>` **process_physics_priority** = ``0``
  706. .. rst-class:: classref-property-setget
  707. - |void| **set_physics_process_priority**\ (\ value\: :ref:`int<class_int>`\ )
  708. - :ref:`int<class_int>` **get_physics_process_priority**\ (\ )
  709. Similar to :ref:`process_priority<class_Node_property_process_priority>` but for :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>`, :ref:`_physics_process<class_Node_private_method__physics_process>` or the internal version.
  710. .. rst-class:: classref-item-separator
  711. ----
  712. .. _class_Node_property_process_priority:
  713. .. rst-class:: classref-property
  714. :ref:`int<class_int>` **process_priority** = ``0``
  715. .. rst-class:: classref-property-setget
  716. - |void| **set_process_priority**\ (\ value\: :ref:`int<class_int>`\ )
  717. - :ref:`int<class_int>` **get_process_priority**\ (\ )
  718. The node's execution order of the process callbacks (:ref:`_process<class_Node_private_method__process>`, :ref:`_physics_process<class_Node_private_method__physics_process>`, and internal processing). Nodes whose priority value is *lower* call their process callbacks first, regardless of tree order.
  719. .. rst-class:: classref-item-separator
  720. ----
  721. .. _class_Node_property_process_thread_group:
  722. .. rst-class:: classref-property
  723. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **process_thread_group** = ``0``
  724. .. rst-class:: classref-property-setget
  725. - |void| **set_process_thread_group**\ (\ value\: :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>`\ )
  726. - :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **get_process_thread_group**\ (\ )
  727. Set the process thread group for this node (basically, whether it receives :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>`, :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>`, :ref:`_process<class_Node_private_method__process>` or :ref:`_physics_process<class_Node_private_method__physics_process>` (and the internal versions) on the main thread or in a sub-thread.
  728. By default, the thread group is :ref:`PROCESS_THREAD_GROUP_INHERIT<class_Node_constant_PROCESS_THREAD_GROUP_INHERIT>`, which means that this node belongs to the same thread group as the parent node. The thread groups means that nodes in a specific thread group will process together, separate to other thread groups (depending on :ref:`process_thread_group_order<class_Node_property_process_thread_group_order>`). If the value is set is :ref:`PROCESS_THREAD_GROUP_SUB_THREAD<class_Node_constant_PROCESS_THREAD_GROUP_SUB_THREAD>`, this thread group will occur on a sub thread (not the main thread), otherwise if set to :ref:`PROCESS_THREAD_GROUP_MAIN_THREAD<class_Node_constant_PROCESS_THREAD_GROUP_MAIN_THREAD>` it will process on the main thread. If there is not a parent or grandparent node set to something other than inherit, the node will belong to the *default thread group*. This default group will process on the main thread and its group order is 0.
  729. During processing in a sub-thread, accessing most functions in nodes outside the thread group is forbidden (and it will result in an error in debug mode). Use :ref:`Object.call_deferred<class_Object_method_call_deferred>`, :ref:`call_thread_safe<class_Node_method_call_thread_safe>`, :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>` and the likes in order to communicate from the thread groups to the main thread (or to other thread groups).
  730. To better understand process thread groups, the idea is that any node set to any other value than :ref:`PROCESS_THREAD_GROUP_INHERIT<class_Node_constant_PROCESS_THREAD_GROUP_INHERIT>` will include any child (and grandchild) nodes set to inherit into its process thread group. This means that the processing of all the nodes in the group will happen together, at the same time as the node including them.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _class_Node_property_process_thread_group_order:
  734. .. rst-class:: classref-property
  735. :ref:`int<class_int>` **process_thread_group_order**
  736. .. rst-class:: classref-property-setget
  737. - |void| **set_process_thread_group_order**\ (\ value\: :ref:`int<class_int>`\ )
  738. - :ref:`int<class_int>` **get_process_thread_group_order**\ (\ )
  739. Change the process thread group order. Groups with a lesser order will process before groups with a greater order. This is useful when a large amount of nodes process in sub thread and, afterwards, another group wants to collect their result in the main thread, as an example.
  740. .. rst-class:: classref-item-separator
  741. ----
  742. .. _class_Node_property_process_thread_messages:
  743. .. rst-class:: classref-property
  744. |bitfield|\[:ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>`\] **process_thread_messages**
  745. .. rst-class:: classref-property-setget
  746. - |void| **set_process_thread_messages**\ (\ value\: |bitfield|\[:ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>`\]\ )
  747. - |bitfield|\[:ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>`\] **get_process_thread_messages**\ (\ )
  748. Set whether the current thread group will process messages (calls to :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>` on threads, and whether it wants to receive them during regular process or physics process callbacks.
  749. .. rst-class:: classref-item-separator
  750. ----
  751. .. _class_Node_property_scene_file_path:
  752. .. rst-class:: classref-property
  753. :ref:`String<class_String>` **scene_file_path**
  754. .. rst-class:: classref-property-setget
  755. - |void| **set_scene_file_path**\ (\ value\: :ref:`String<class_String>`\ )
  756. - :ref:`String<class_String>` **get_scene_file_path**\ (\ )
  757. The original scene's file path, if the node has been instantiated from a :ref:`PackedScene<class_PackedScene>` file. Only scene root nodes contains this.
  758. .. rst-class:: classref-item-separator
  759. ----
  760. .. _class_Node_property_unique_name_in_owner:
  761. .. rst-class:: classref-property
  762. :ref:`bool<class_bool>` **unique_name_in_owner** = ``false``
  763. .. rst-class:: classref-property-setget
  764. - |void| **set_unique_name_in_owner**\ (\ value\: :ref:`bool<class_bool>`\ )
  765. - :ref:`bool<class_bool>` **is_unique_name_in_owner**\ (\ )
  766. If ``true``, the node can be accessed from any node sharing the same :ref:`owner<class_Node_property_owner>` or from the :ref:`owner<class_Node_property_owner>` itself, with special ``%Name`` syntax in :ref:`get_node<class_Node_method_get_node>`.
  767. \ **Note:** If another node with the same :ref:`owner<class_Node_property_owner>` shares the same :ref:`name<class_Node_property_name>` as this node, the other node will no longer be accessible as unique.
  768. .. rst-class:: classref-section-separator
  769. ----
  770. .. rst-class:: classref-descriptions-group
  771. Method Descriptions
  772. -------------------
  773. .. _class_Node_private_method__enter_tree:
  774. .. rst-class:: classref-method
  775. |void| **_enter_tree**\ (\ ) |virtual|
  776. Called when the node enters the :ref:`SceneTree<class_SceneTree>` (e.g. upon instantiating, scene changing, or after calling :ref:`add_child<class_Node_method_add_child>` in a script). If the node has children, its :ref:`_enter_tree<class_Node_private_method__enter_tree>` callback will be called first, and then that of the children.
  777. Corresponds to the :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification in :ref:`Object._notification<class_Object_private_method__notification>`.
  778. .. rst-class:: classref-item-separator
  779. ----
  780. .. _class_Node_private_method__exit_tree:
  781. .. rst-class:: classref-method
  782. |void| **_exit_tree**\ (\ ) |virtual|
  783. Called when the node is about to leave the :ref:`SceneTree<class_SceneTree>` (e.g. upon freeing, scene changing, or after calling :ref:`remove_child<class_Node_method_remove_child>` in a script). If the node has children, its :ref:`_exit_tree<class_Node_private_method__exit_tree>` callback will be called last, after all its children have left the tree.
  784. Corresponds to the :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>` notification in :ref:`Object._notification<class_Object_private_method__notification>` and signal :ref:`tree_exiting<class_Node_signal_tree_exiting>`. To get notified when the node has already left the active tree, connect to the :ref:`tree_exited<class_Node_signal_tree_exited>`.
  785. .. rst-class:: classref-item-separator
  786. ----
  787. .. _class_Node_private_method__get_configuration_warnings:
  788. .. rst-class:: classref-method
  789. :ref:`PackedStringArray<class_PackedStringArray>` **_get_configuration_warnings**\ (\ ) |virtual| |const|
  790. The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a ``tool`` script.
  791. Returning an empty array produces no warnings.
  792. Call :ref:`update_configuration_warnings<class_Node_method_update_configuration_warnings>` when the warnings need to be updated for this node.
  793. ::
  794. @export var energy = 0:
  795. set(value):
  796. energy = value
  797. update_configuration_warnings()
  798. func _get_configuration_warnings():
  799. if energy < 0:
  800. return ["Energy must be 0 or greater."]
  801. else:
  802. return []
  803. .. rst-class:: classref-item-separator
  804. ----
  805. .. _class_Node_private_method__input:
  806. .. rst-class:: classref-method
  807. |void| **_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual|
  808. Called when there is an input event. The input event propagates up through the node tree until a node consumes it.
  809. It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_input<class_Node_method_set_process_input>`.
  810. To consume the input event and stop it propagating further to other nodes, :ref:`Viewport.set_input_as_handled<class_Viewport_method_set_input_as_handled>` can be called.
  811. For gameplay input, :ref:`_unhandled_input<class_Node_private_method__unhandled_input>` and :ref:`_unhandled_key_input<class_Node_private_method__unhandled_key_input>` are usually a better fit as they allow the GUI to intercept the events first.
  812. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  813. .. rst-class:: classref-item-separator
  814. ----
  815. .. _class_Node_private_method__physics_process:
  816. .. rst-class:: classref-method
  817. |void| **_physics_process**\ (\ delta\: :ref:`float<class_float>`\ ) |virtual|
  818. Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the ``delta`` variable should be constant. ``delta`` is in seconds.
  819. It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_physics_process<class_Node_method_set_physics_process>`.
  820. Corresponds to the :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` notification in :ref:`Object._notification<class_Object_private_method__notification>`.
  821. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  822. .. rst-class:: classref-item-separator
  823. ----
  824. .. _class_Node_private_method__process:
  825. .. rst-class:: classref-method
  826. |void| **_process**\ (\ delta\: :ref:`float<class_float>`\ ) |virtual|
  827. Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the ``delta`` time since the previous frame is not constant. ``delta`` is in seconds.
  828. It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process<class_Node_method_set_process>`.
  829. Corresponds to the :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>` notification in :ref:`Object._notification<class_Object_private_method__notification>`.
  830. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  831. .. rst-class:: classref-item-separator
  832. ----
  833. .. _class_Node_private_method__ready:
  834. .. rst-class:: classref-method
  835. |void| **_ready**\ (\ ) |virtual|
  836. Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their :ref:`_ready<class_Node_private_method__ready>` callbacks get triggered first, and the parent node will receive the ready notification afterwards.
  837. Corresponds to the :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` notification in :ref:`Object._notification<class_Object_private_method__notification>`. See also the ``@onready`` annotation for variables.
  838. Usually used for initialization. For even earlier initialization, :ref:`Object._init<class_Object_private_method__init>` may be used. See also :ref:`_enter_tree<class_Node_private_method__enter_tree>`.
  839. \ **Note:** This method may be called only once for each node. After removing a node from the scene tree and adding it again, :ref:`_ready<class_Node_private_method__ready>` will **not** be called a second time. This can be bypassed by requesting another call with :ref:`request_ready<class_Node_method_request_ready>`, which may be called anywhere before adding the node again.
  840. .. rst-class:: classref-item-separator
  841. ----
  842. .. _class_Node_private_method__shortcut_input:
  843. .. rst-class:: classref-method
  844. |void| **_shortcut_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual|
  845. Called when an :ref:`InputEventKey<class_InputEventKey>` or :ref:`InputEventShortcut<class_InputEventShortcut>` hasn't been consumed by :ref:`_input<class_Node_private_method__input>` or any GUI :ref:`Control<class_Control>` item. It is called before :ref:`_unhandled_key_input<class_Node_private_method__unhandled_key_input>` and :ref:`_unhandled_input<class_Node_private_method__unhandled_input>`. The input event propagates up through the node tree until a node consumes it.
  846. It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>`.
  847. To consume the input event and stop it propagating further to other nodes, :ref:`Viewport.set_input_as_handled<class_Viewport_method_set_input_as_handled>` can be called.
  848. This method can be used to handle shortcuts. For generic GUI events, use :ref:`_input<class_Node_private_method__input>` instead. Gameplay events should usually be handled with either :ref:`_unhandled_input<class_Node_private_method__unhandled_input>` or :ref:`_unhandled_key_input<class_Node_private_method__unhandled_key_input>`.
  849. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
  850. .. rst-class:: classref-item-separator
  851. ----
  852. .. _class_Node_private_method__unhandled_input:
  853. .. rst-class:: classref-method
  854. |void| **_unhandled_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual|
  855. Called when an :ref:`InputEvent<class_InputEvent>` hasn't been consumed by :ref:`_input<class_Node_private_method__input>` or any GUI :ref:`Control<class_Control>` item. It is called after :ref:`_shortcut_input<class_Node_private_method__shortcut_input>` and after :ref:`_unhandled_key_input<class_Node_private_method__unhandled_key_input>`. The input event propagates up through the node tree until a node consumes it.
  856. It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>`.
  857. To consume the input event and stop it propagating further to other nodes, :ref:`Viewport.set_input_as_handled<class_Viewport_method_set_input_as_handled>` can be called.
  858. For gameplay input, this method is usually a better fit than :ref:`_input<class_Node_private_method__input>`, as GUI events need a higher priority. For keyboard shortcuts, consider using :ref:`_shortcut_input<class_Node_private_method__shortcut_input>` instead, as it is called before this method. Finally, to handle keyboard events, consider using :ref:`_unhandled_key_input<class_Node_private_method__unhandled_key_input>` for performance reasons.
  859. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  860. .. rst-class:: classref-item-separator
  861. ----
  862. .. _class_Node_private_method__unhandled_key_input:
  863. .. rst-class:: classref-method
  864. |void| **_unhandled_key_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual|
  865. Called when an :ref:`InputEventKey<class_InputEventKey>` hasn't been consumed by :ref:`_input<class_Node_private_method__input>` or any GUI :ref:`Control<class_Control>` item. It is called after :ref:`_shortcut_input<class_Node_private_method__shortcut_input>` but before :ref:`_unhandled_input<class_Node_private_method__unhandled_input>`. The input event propagates up through the node tree until a node consumes it.
  866. It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_unhandled_key_input<class_Node_method_set_process_unhandled_key_input>`.
  867. To consume the input event and stop it propagating further to other nodes, :ref:`Viewport.set_input_as_handled<class_Viewport_method_set_input_as_handled>` can be called.
  868. This method can be used to handle Unicode character input with :kbd:`Alt`, :kbd:`Alt + Ctrl`, and :kbd:`Alt + Shift` modifiers, after shortcuts were handled.
  869. For gameplay input, this and :ref:`_unhandled_input<class_Node_private_method__unhandled_input>` are usually a better fit than :ref:`_input<class_Node_private_method__input>`, as GUI events should be handled first. This method also performs better than :ref:`_unhandled_input<class_Node_private_method__unhandled_input>`, since unrelated events such as :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` are automatically filtered. For shortcuts, consider using :ref:`_shortcut_input<class_Node_private_method__shortcut_input>` instead.
  870. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  871. .. rst-class:: classref-item-separator
  872. ----
  873. .. _class_Node_method_add_child:
  874. .. rst-class:: classref-method
  875. |void| **add_child**\ (\ node\: :ref:`Node<class_Node>`, force_readable_name\: :ref:`bool<class_bool>` = false, internal\: :ref:`InternalMode<enum_Node_InternalMode>` = 0\ )
  876. Adds a child ``node``. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
  877. If ``force_readable_name`` is ``true``, improves the readability of the added ``node``. If not named, the ``node`` is renamed to its type, and if it shares :ref:`name<class_Node_property_name>` with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to ``false``, which assigns a dummy name featuring ``@`` in both situations.
  878. If ``internal`` is different than :ref:`INTERNAL_MODE_DISABLED<class_Node_constant_INTERNAL_MODE_DISABLED>`, the child will be added as internal node. These nodes are ignored by methods like :ref:`get_children<class_Node_method_get_children>`, unless their parameter ``include_internal`` is ``true``. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. :ref:`ColorPicker<class_ColorPicker>`. See :ref:`InternalMode<enum_Node_InternalMode>` for available modes.
  879. \ **Note:** If ``node`` already has a parent, this method will fail. Use :ref:`remove_child<class_Node_method_remove_child>` first to remove ``node`` from its current parent. For example:
  880. .. tabs::
  881. .. code-tab:: gdscript
  882. var child_node = get_child(0)
  883. if child_node.get_parent():
  884. child_node.get_parent().remove_child(child_node)
  885. add_child(child_node)
  886. .. code-tab:: csharp
  887. Node childNode = GetChild(0);
  888. if (childNode.GetParent() != null)
  889. {
  890. childNode.GetParent().RemoveChild(childNode);
  891. }
  892. AddChild(childNode);
  893. If you need the child node to be added below a specific node in the list of children, use :ref:`add_sibling<class_Node_method_add_sibling>` instead of this method.
  894. \ **Note:** If you want a child to be persisted to a :ref:`PackedScene<class_PackedScene>`, you must set :ref:`owner<class_Node_property_owner>` in addition to calling :ref:`add_child<class_Node_method_add_child>`. This is typically relevant for :doc:`tool scripts <../tutorials/plugins/running_code_in_the_editor>` and :doc:`editor plugins <../tutorials/plugins/editor/index>`. If :ref:`add_child<class_Node_method_add_child>` is called without setting :ref:`owner<class_Node_property_owner>`, the newly added **Node** will not be visible in the scene tree, though it will be visible in the 2D/3D view.
  895. .. rst-class:: classref-item-separator
  896. ----
  897. .. _class_Node_method_add_sibling:
  898. .. rst-class:: classref-method
  899. |void| **add_sibling**\ (\ sibling\: :ref:`Node<class_Node>`, force_readable_name\: :ref:`bool<class_bool>` = false\ )
  900. Adds a ``sibling`` node to this node's parent, and moves the added sibling right below this node.
  901. If ``force_readable_name`` is ``true``, improves the readability of the added ``sibling``. If not named, the ``sibling`` is renamed to its type, and if it shares :ref:`name<class_Node_property_name>` with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to ``false``, which assigns a dummy name featuring ``@`` in both situations.
  902. Use :ref:`add_child<class_Node_method_add_child>` instead of this method if you don't need the child node to be added below a specific node in the list of children.
  903. \ **Note:** If this node is internal, the added sibling will be internal too (see :ref:`add_child<class_Node_method_add_child>`'s ``internal`` parameter).
  904. .. rst-class:: classref-item-separator
  905. ----
  906. .. _class_Node_method_add_to_group:
  907. .. rst-class:: classref-method
  908. |void| **add_to_group**\ (\ group\: :ref:`StringName<class_StringName>`, persistent\: :ref:`bool<class_bool>` = false\ )
  909. Adds the node to the ``group``. Groups can be helpful to organize a subset of nodes, for example ``"enemies"`` or ``"collectables"``. See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  910. If ``persistent`` is ``true``, the group will be stored when saved inside a :ref:`PackedScene<class_PackedScene>`. All groups created and displayed in the Node dock are persistent.
  911. \ **Note:** To improve performance, the order of group names is *not* guaranteed and may vary between project runs. Therefore, do not rely on the group order.
  912. \ **Note:** :ref:`SceneTree<class_SceneTree>`'s group methods will *not* work on this node if not inside the tree (see :ref:`is_inside_tree<class_Node_method_is_inside_tree>`).
  913. .. rst-class:: classref-item-separator
  914. ----
  915. .. _class_Node_method_atr:
  916. .. rst-class:: classref-method
  917. :ref:`String<class_String>` **atr**\ (\ message\: :ref:`String<class_String>`, context\: :ref:`StringName<class_StringName>` = ""\ ) |const|
  918. Translates a ``message``, using the translation catalogs configured in the Project Settings. Further ``context`` can be specified to help with the translation.
  919. This method works the same as :ref:`Object.tr<class_Object_method_tr>`, with the addition of respecting the :ref:`auto_translate_mode<class_Node_property_auto_translate_mode>` state.
  920. If :ref:`Object.can_translate_messages<class_Object_method_can_translate_messages>` is ``false``, or no translation is available, this method returns the ``message`` without changes. See :ref:`Object.set_message_translation<class_Object_method_set_message_translation>`.
  921. For detailed examples, see :doc:`Internationalizing games <../tutorials/i18n/internationalizing_games>`.
  922. .. rst-class:: classref-item-separator
  923. ----
  924. .. _class_Node_method_atr_n:
  925. .. rst-class:: classref-method
  926. :ref:`String<class_String>` **atr_n**\ (\ message\: :ref:`String<class_String>`, plural_message\: :ref:`StringName<class_StringName>`, n\: :ref:`int<class_int>`, context\: :ref:`StringName<class_StringName>` = ""\ ) |const|
  927. Translates a ``message`` or ``plural_message``, using the translation catalogs configured in the Project Settings. Further ``context`` can be specified to help with the translation.
  928. This method works the same as :ref:`Object.tr_n<class_Object_method_tr_n>`, with the addition of respecting the :ref:`auto_translate_mode<class_Node_property_auto_translate_mode>` state.
  929. If :ref:`Object.can_translate_messages<class_Object_method_can_translate_messages>` is ``false``, or no translation is available, this method returns ``message`` or ``plural_message``, without changes. See :ref:`Object.set_message_translation<class_Object_method_set_message_translation>`.
  930. The ``n`` is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language.
  931. For detailed examples, see :doc:`Localization using gettext <../tutorials/i18n/localization_using_gettext>`.
  932. \ **Note:** Negative and :ref:`float<class_float>` numbers may not properly apply to some countable subjects. It's recommended to handle these cases with :ref:`atr<class_Node_method_atr>`.
  933. .. rst-class:: classref-item-separator
  934. ----
  935. .. _class_Node_method_call_deferred_thread_group:
  936. .. rst-class:: classref-method
  937. :ref:`Variant<class_Variant>` **call_deferred_thread_group**\ (\ method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg|
  938. This function is similar to :ref:`Object.call_deferred<class_Object_method_call_deferred>` except that the call will take place when the node thread group is processed. If the node thread group processes in sub-threads, then the call will be done on that thread, right before :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>` or :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>`, the :ref:`_process<class_Node_private_method__process>` or :ref:`_physics_process<class_Node_private_method__physics_process>` or their internal versions are called.
  939. .. rst-class:: classref-item-separator
  940. ----
  941. .. _class_Node_method_call_thread_safe:
  942. .. rst-class:: classref-method
  943. :ref:`Variant<class_Variant>` **call_thread_safe**\ (\ method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg|
  944. This function ensures that the calling of this function will succeed, no matter whether it's being done from a thread or not. If called from a thread that is not allowed to call the function, the call will become deferred. Otherwise, the call will go through directly.
  945. .. rst-class:: classref-item-separator
  946. ----
  947. .. _class_Node_method_can_process:
  948. .. rst-class:: classref-method
  949. :ref:`bool<class_bool>` **can_process**\ (\ ) |const|
  950. Returns ``true`` if the node can receive processing notifications and input callbacks (:ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>`, :ref:`_input<class_Node_private_method__input>`, etc.) from the :ref:`SceneTree<class_SceneTree>` and :ref:`Viewport<class_Viewport>`. The returned value depends on :ref:`process_mode<class_Node_property_process_mode>`:
  951. - If set to :ref:`PROCESS_MODE_PAUSABLE<class_Node_constant_PROCESS_MODE_PAUSABLE>`, returns ``true`` when the game is processing, i.e. :ref:`SceneTree.paused<class_SceneTree_property_paused>` is ``false``;
  952. - If set to :ref:`PROCESS_MODE_WHEN_PAUSED<class_Node_constant_PROCESS_MODE_WHEN_PAUSED>`, returns ``true`` when the game is paused, i.e. :ref:`SceneTree.paused<class_SceneTree_property_paused>` is ``true``;
  953. - If set to :ref:`PROCESS_MODE_ALWAYS<class_Node_constant_PROCESS_MODE_ALWAYS>`, always returns ``true``;
  954. - If set to :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`, always returns ``false``;
  955. - If set to :ref:`PROCESS_MODE_INHERIT<class_Node_constant_PROCESS_MODE_INHERIT>`, use the parent node's :ref:`process_mode<class_Node_property_process_mode>` to determine the result.
  956. If the node is not inside the tree, returns ``false`` no matter the value of :ref:`process_mode<class_Node_property_process_mode>`.
  957. .. rst-class:: classref-item-separator
  958. ----
  959. .. _class_Node_method_create_tween:
  960. .. rst-class:: classref-method
  961. :ref:`Tween<class_Tween>` **create_tween**\ (\ )
  962. Creates a new :ref:`Tween<class_Tween>` and binds it to this node.
  963. This is the equivalent of doing:
  964. .. tabs::
  965. .. code-tab:: gdscript
  966. get_tree().create_tween().bind_node(self)
  967. .. code-tab:: csharp
  968. GetTree().CreateTween().BindNode(this);
  969. The Tween will start automatically on the next process frame or physics frame (depending on :ref:`TweenProcessMode<enum_Tween_TweenProcessMode>`). See :ref:`Tween.bind_node<class_Tween_method_bind_node>` for more info on Tweens bound to nodes.
  970. \ **Note:** The method can still be used when the node is not inside :ref:`SceneTree<class_SceneTree>`. It can fail in an unlikely case of using a custom :ref:`MainLoop<class_MainLoop>`.
  971. .. rst-class:: classref-item-separator
  972. ----
  973. .. _class_Node_method_duplicate:
  974. .. rst-class:: classref-method
  975. :ref:`Node<class_Node>` **duplicate**\ (\ flags\: :ref:`int<class_int>` = 15\ ) |const|
  976. Duplicates the node, returning a new node with all of its properties, signals and groups copied from the original. The behavior can be tweaked through the ``flags`` (see :ref:`DuplicateFlags<enum_Node_DuplicateFlags>`).
  977. \ **Note:** For nodes with a :ref:`Script<class_Script>` attached, if :ref:`Object._init<class_Object_private_method__init>` has been defined with required parameters, the duplicated node will not have a :ref:`Script<class_Script>`.
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_Node_method_find_child:
  981. .. rst-class:: classref-method
  982. :ref:`Node<class_Node>` **find_child**\ (\ pattern\: :ref:`String<class_String>`, recursive\: :ref:`bool<class_bool>` = true, owned\: :ref:`bool<class_bool>` = true\ ) |const|
  983. Finds the first descendant of this node whose :ref:`name<class_Node_property_name>` matches ``pattern``, returning ``null`` if no match is found. The matching is done against node names, *not* their paths, through :ref:`String.match<class_String_method_match>`. As such, it is case-sensitive, ``"*"`` matches zero or more characters, and ``"?"`` matches any single character.
  984. If ``recursive`` is ``false``, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  985. If ``owned`` is ``true``, only descendants with a valid :ref:`owner<class_Node_property_owner>` node are checked.
  986. \ **Note:** This method can be very slow. Consider storing a reference to the found node in a variable. Alternatively, use :ref:`get_node<class_Node_method_get_node>` with unique names (see :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>`).
  987. \ **Note:** To find all descendant nodes matching a pattern or a class type, see :ref:`find_children<class_Node_method_find_children>`.
  988. .. rst-class:: classref-item-separator
  989. ----
  990. .. _class_Node_method_find_children:
  991. .. rst-class:: classref-method
  992. :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **find_children**\ (\ pattern\: :ref:`String<class_String>`, type\: :ref:`String<class_String>` = "", recursive\: :ref:`bool<class_bool>` = true, owned\: :ref:`bool<class_bool>` = true\ ) |const|
  993. Finds all descendants of this node whose names match ``pattern``, returning an empty :ref:`Array<class_Array>` if no match is found. The matching is done against node names, *not* their paths, through :ref:`String.match<class_String_method_match>`. As such, it is case-sensitive, ``"*"`` matches zero or more characters, and ``"?"`` matches any single character.
  994. If ``type`` is not empty, only ancestors inheriting from ``type`` are included (see :ref:`Object.is_class<class_Object_method_is_class>`).
  995. If ``recursive`` is ``false``, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  996. If ``owned`` is ``true``, only descendants with a valid :ref:`owner<class_Node_property_owner>` node are checked.
  997. \ **Note:** This method can be very slow. Consider storing references to the found nodes in a variable.
  998. \ **Note:** To find a single descendant node matching a pattern, see :ref:`find_child<class_Node_method_find_child>`.
  999. .. rst-class:: classref-item-separator
  1000. ----
  1001. .. _class_Node_method_find_parent:
  1002. .. rst-class:: classref-method
  1003. :ref:`Node<class_Node>` **find_parent**\ (\ pattern\: :ref:`String<class_String>`\ ) |const|
  1004. Finds the first ancestor of this node whose :ref:`name<class_Node_property_name>` matches ``pattern``, returning ``null`` if no match is found. The matching is done through :ref:`String.match<class_String_method_match>`. As such, it is case-sensitive, ``"*"`` matches zero or more characters, and ``"?"`` matches any single character. See also :ref:`find_child<class_Node_method_find_child>` and :ref:`find_children<class_Node_method_find_children>`.
  1005. \ **Note:** As this method walks upwards in the scene tree, it can be slow in large, deeply nested nodes. Consider storing a reference to the found node in a variable. Alternatively, use :ref:`get_node<class_Node_method_get_node>` with unique names (see :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>`).
  1006. .. rst-class:: classref-item-separator
  1007. ----
  1008. .. _class_Node_method_get_child:
  1009. .. rst-class:: classref-method
  1010. :ref:`Node<class_Node>` **get_child**\ (\ idx\: :ref:`int<class_int>`, include_internal\: :ref:`bool<class_bool>` = false\ ) |const|
  1011. Fetches a child node by its index. Each child node has an index relative its siblings (see :ref:`get_index<class_Node_method_get_index>`). The first child is at index 0. Negative values can also be used to start from the end of the list. This method can be used in combination with :ref:`get_child_count<class_Node_method_get_child_count>` to iterate over this node's children. If no child exists at the given index, this method returns ``null`` and an error is generated.
  1012. If ``include_internal`` is ``false``, internal children are ignored (see :ref:`add_child<class_Node_method_add_child>`'s ``internal`` parameter).
  1013. ::
  1014. # Assuming the following are children of this node, in order:
  1015. # First, Middle, Last.
  1016. var a = get_child(0).name # a is "First"
  1017. var b = get_child(1).name # b is "Middle"
  1018. var b = get_child(2).name # b is "Last"
  1019. var c = get_child(-1).name # c is "Last"
  1020. \ **Note:** To fetch a node by :ref:`NodePath<class_NodePath>`, use :ref:`get_node<class_Node_method_get_node>`.
  1021. .. rst-class:: classref-item-separator
  1022. ----
  1023. .. _class_Node_method_get_child_count:
  1024. .. rst-class:: classref-method
  1025. :ref:`int<class_int>` **get_child_count**\ (\ include_internal\: :ref:`bool<class_bool>` = false\ ) |const|
  1026. Returns the number of children of this node.
  1027. If ``include_internal`` is ``false``, internal children are not counted (see :ref:`add_child<class_Node_method_add_child>`'s ``internal`` parameter).
  1028. .. rst-class:: classref-item-separator
  1029. ----
  1030. .. _class_Node_method_get_children:
  1031. .. rst-class:: classref-method
  1032. :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_children**\ (\ include_internal\: :ref:`bool<class_bool>` = false\ ) |const|
  1033. Returns all children of this node inside an :ref:`Array<class_Array>`.
  1034. If ``include_internal`` is ``false``, excludes internal children from the returned array (see :ref:`add_child<class_Node_method_add_child>`'s ``internal`` parameter).
  1035. .. rst-class:: classref-item-separator
  1036. ----
  1037. .. _class_Node_method_get_groups:
  1038. .. rst-class:: classref-method
  1039. :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] **get_groups**\ (\ ) |const|
  1040. Returns an :ref:`Array<class_Array>` of group names that the node has been added to.
  1041. \ **Note:** To improve performance, the order of group names is *not* guaranteed and may vary between project runs. Therefore, do not rely on the group order.
  1042. \ **Note:** This method may also return some group names starting with an underscore (``_``). These are internally used by the engine. To avoid conflicts, do not use custom groups starting with underscores. To exclude internal groups, see the following code snippet:
  1043. .. tabs::
  1044. .. code-tab:: gdscript
  1045. # Stores the node's non-internal groups only (as an array of StringNames).
  1046. var non_internal_groups = []
  1047. for group in get_groups():
  1048. if not str(group).begins_with("_"):
  1049. non_internal_groups.push_back(group)
  1050. .. code-tab:: csharp
  1051. // Stores the node's non-internal groups only (as a List of StringNames).
  1052. List<string> nonInternalGroups = new List<string>();
  1053. foreach (string group in GetGroups())
  1054. {
  1055. if (!group.BeginsWith("_"))
  1056. nonInternalGroups.Add(group);
  1057. }
  1058. .. rst-class:: classref-item-separator
  1059. ----
  1060. .. _class_Node_method_get_index:
  1061. .. rst-class:: classref-method
  1062. :ref:`int<class_int>` **get_index**\ (\ include_internal\: :ref:`bool<class_bool>` = false\ ) |const|
  1063. Returns this node's order among its siblings. The first node's index is ``0``. See also :ref:`get_child<class_Node_method_get_child>`.
  1064. If ``include_internal`` is ``false``, returns the index ignoring internal children. The first, non-internal child will have an index of ``0`` (see :ref:`add_child<class_Node_method_add_child>`'s ``internal`` parameter).
  1065. .. rst-class:: classref-item-separator
  1066. ----
  1067. .. _class_Node_method_get_last_exclusive_window:
  1068. .. rst-class:: classref-method
  1069. :ref:`Window<class_Window>` **get_last_exclusive_window**\ (\ ) |const|
  1070. Returns the :ref:`Window<class_Window>` that contains this node, or the last exclusive child in a chain of windows starting with the one that contains this node.
  1071. .. rst-class:: classref-item-separator
  1072. ----
  1073. .. _class_Node_method_get_multiplayer_authority:
  1074. .. rst-class:: classref-method
  1075. :ref:`int<class_int>` **get_multiplayer_authority**\ (\ ) |const|
  1076. Returns the peer ID of the multiplayer authority for this node. See :ref:`set_multiplayer_authority<class_Node_method_set_multiplayer_authority>`.
  1077. .. rst-class:: classref-item-separator
  1078. ----
  1079. .. _class_Node_method_get_node:
  1080. .. rst-class:: classref-method
  1081. :ref:`Node<class_Node>` **get_node**\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |const|
  1082. Fetches a node. The :ref:`NodePath<class_NodePath>` can either be a relative path (from this node), or an absolute path (from the :ref:`SceneTree.root<class_SceneTree_property_root>`) to a node. If ``path`` does not point to a valid node, generates an error and returns ``null``. Attempts to access methods on the return value will result in an *"Attempt to call <method> on a null instance."* error.
  1083. \ **Note:** Fetching by absolute path only works when the node is inside the scene tree (see :ref:`is_inside_tree<class_Node_method_is_inside_tree>`).
  1084. \ **Example:** Assume this method is called from the Character node, inside the following tree:
  1085. ::
  1086. ┖╴root
  1087. ┠╴Character (you are here!)
  1088. ┃ ┠╴Sword
  1089. ┃ ┖╴Backpack
  1090. ┃ ┖╴Dagger
  1091. ┠╴MyGame
  1092. ┖╴Swamp
  1093. ┠╴Alligator
  1094. ┠╴Mosquito
  1095. ┖╴Goblin
  1096. The following calls will return a valid node:
  1097. .. tabs::
  1098. .. code-tab:: gdscript
  1099. get_node("Sword")
  1100. get_node("Backpack/Dagger")
  1101. get_node("../Swamp/Alligator")
  1102. get_node("/root/MyGame")
  1103. .. code-tab:: csharp
  1104. GetNode("Sword");
  1105. GetNode("Backpack/Dagger");
  1106. GetNode("../Swamp/Alligator");
  1107. GetNode("/root/MyGame");
  1108. .. rst-class:: classref-item-separator
  1109. ----
  1110. .. _class_Node_method_get_node_and_resource:
  1111. .. rst-class:: classref-method
  1112. :ref:`Array<class_Array>` **get_node_and_resource**\ (\ path\: :ref:`NodePath<class_NodePath>`\ )
  1113. Fetches a node and its most nested resource as specified by the :ref:`NodePath<class_NodePath>`'s subname. Returns an :ref:`Array<class_Array>` of size ``3`` where:
  1114. - Element ``0`` is the **Node**, or ``null`` if not found;
  1115. - Element ``1`` is the subname's last nested :ref:`Resource<class_Resource>`, or ``null`` if not found;
  1116. - Element ``2`` is the remaining :ref:`NodePath<class_NodePath>`, referring to an existing, non-:ref:`Resource<class_Resource>` property (see :ref:`Object.get_indexed<class_Object_method_get_indexed>`).
  1117. \ **Example:** Assume that the child's :ref:`Sprite2D.texture<class_Sprite2D_property_texture>` has been assigned a :ref:`AtlasTexture<class_AtlasTexture>`:
  1118. .. tabs::
  1119. .. code-tab:: gdscript
  1120. var a = get_node_and_resource("Area2D/Sprite2D")
  1121. print(a[0].name) # Prints Sprite2D
  1122. print(a[1]) # Prints <null>
  1123. print(a[2]) # Prints ^""
  1124. var b = get_node_and_resource("Area2D/Sprite2D:texture:atlas")
  1125. print(b[0].name) # Prints Sprite2D
  1126. print(b[1].get_class()) # Prints AtlasTexture
  1127. print(b[2]) # Prints ^""
  1128. var c = get_node_and_resource("Area2D/Sprite2D:texture:atlas:region")
  1129. print(c[0].name) # Prints Sprite2D
  1130. print(c[1].get_class()) # Prints AtlasTexture
  1131. print(c[2]) # Prints ^":region"
  1132. .. code-tab:: csharp
  1133. var a = GetNodeAndResource(NodePath("Area2D/Sprite2D"));
  1134. GD.Print(a[0].Name); // Prints Sprite2D
  1135. GD.Print(a[1]); // Prints <null>
  1136. GD.Print(a[2]); // Prints ^"
  1137. var b = GetNodeAndResource(NodePath("Area2D/Sprite2D:texture:atlas"));
  1138. GD.Print(b[0].name); // Prints Sprite2D
  1139. GD.Print(b[1].get_class()); // Prints AtlasTexture
  1140. GD.Print(b[2]); // Prints ^""
  1141. var c = GetNodeAndResource(NodePath("Area2D/Sprite2D:texture:atlas:region"));
  1142. GD.Print(c[0].name); // Prints Sprite2D
  1143. GD.Print(c[1].get_class()); // Prints AtlasTexture
  1144. GD.Print(c[2]); // Prints ^":region"
  1145. .. rst-class:: classref-item-separator
  1146. ----
  1147. .. _class_Node_method_get_node_or_null:
  1148. .. rst-class:: classref-method
  1149. :ref:`Node<class_Node>` **get_node_or_null**\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |const|
  1150. Fetches a node by :ref:`NodePath<class_NodePath>`. Similar to :ref:`get_node<class_Node_method_get_node>`, but does not generate an error if ``path`` does not point to a valid node.
  1151. .. rst-class:: classref-item-separator
  1152. ----
  1153. .. _class_Node_method_get_parent:
  1154. .. rst-class:: classref-method
  1155. :ref:`Node<class_Node>` **get_parent**\ (\ ) |const|
  1156. Returns this node's parent node, or ``null`` if the node doesn't have a parent.
  1157. .. rst-class:: classref-item-separator
  1158. ----
  1159. .. _class_Node_method_get_path:
  1160. .. rst-class:: classref-method
  1161. :ref:`NodePath<class_NodePath>` **get_path**\ (\ ) |const|
  1162. Returns the node's absolute path, relative to the :ref:`SceneTree.root<class_SceneTree_property_root>`. If the node is not inside the scene tree, this method fails and returns an empty :ref:`NodePath<class_NodePath>`.
  1163. .. rst-class:: classref-item-separator
  1164. ----
  1165. .. _class_Node_method_get_path_to:
  1166. .. rst-class:: classref-method
  1167. :ref:`NodePath<class_NodePath>` **get_path_to**\ (\ node\: :ref:`Node<class_Node>`, use_unique_path\: :ref:`bool<class_bool>` = false\ ) |const|
  1168. Returns the relative :ref:`NodePath<class_NodePath>` from this node to the specified ``node``. Both nodes must be in the same :ref:`SceneTree<class_SceneTree>` or scene hierarchy, otherwise this method fails and returns an empty :ref:`NodePath<class_NodePath>`.
  1169. If ``use_unique_path`` is ``true``, returns the shortest path accounting for this node's unique name (see :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>`).
  1170. \ **Note:** If you get a relative path which starts from a unique node, the path may be longer than a normal relative path, due to the addition of the unique node's name.
  1171. .. rst-class:: classref-item-separator
  1172. ----
  1173. .. _class_Node_method_get_physics_process_delta_time:
  1174. .. rst-class:: classref-method
  1175. :ref:`float<class_float>` **get_physics_process_delta_time**\ (\ ) |const|
  1176. Returns the time elapsed (in seconds) since the last physics callback. This value is identical to :ref:`_physics_process<class_Node_private_method__physics_process>`'s ``delta`` parameter, and is often consistent at run-time, unless :ref:`Engine.physics_ticks_per_second<class_Engine_property_physics_ticks_per_second>` is changed. See also :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>`.
  1177. .. rst-class:: classref-item-separator
  1178. ----
  1179. .. _class_Node_method_get_process_delta_time:
  1180. .. rst-class:: classref-method
  1181. :ref:`float<class_float>` **get_process_delta_time**\ (\ ) |const|
  1182. Returns the time elapsed (in seconds) since the last process callback. This value is identical to :ref:`_process<class_Node_private_method__process>`'s ``delta`` parameter, and may vary from frame to frame. See also :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>`.
  1183. .. rst-class:: classref-item-separator
  1184. ----
  1185. .. _class_Node_method_get_scene_instance_load_placeholder:
  1186. .. rst-class:: classref-method
  1187. :ref:`bool<class_bool>` **get_scene_instance_load_placeholder**\ (\ ) |const|
  1188. Returns ``true`` if this node is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>` and :ref:`set_scene_instance_load_placeholder<class_Node_method_set_scene_instance_load_placeholder>`.
  1189. .. rst-class:: classref-item-separator
  1190. ----
  1191. .. _class_Node_method_get_tree:
  1192. .. rst-class:: classref-method
  1193. :ref:`SceneTree<class_SceneTree>` **get_tree**\ (\ ) |const|
  1194. Returns the :ref:`SceneTree<class_SceneTree>` that contains this node. If this node is not inside the tree, generates an error and returns ``null``. See also :ref:`is_inside_tree<class_Node_method_is_inside_tree>`.
  1195. .. rst-class:: classref-item-separator
  1196. ----
  1197. .. _class_Node_method_get_tree_string:
  1198. .. rst-class:: classref-method
  1199. :ref:`String<class_String>` **get_tree_string**\ (\ )
  1200. Returns the tree as a :ref:`String<class_String>`. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the :ref:`get_node<class_Node_method_get_node>` function. It also can be used in game UI/UX.
  1201. \ **Example output:**\
  1202. ::
  1203. TheGame
  1204. TheGame/Menu
  1205. TheGame/Menu/Label
  1206. TheGame/Menu/Camera2D
  1207. TheGame/SplashScreen
  1208. TheGame/SplashScreen/Camera2D
  1209. .. rst-class:: classref-item-separator
  1210. ----
  1211. .. _class_Node_method_get_tree_string_pretty:
  1212. .. rst-class:: classref-method
  1213. :ref:`String<class_String>` **get_tree_string_pretty**\ (\ )
  1214. Similar to :ref:`get_tree_string<class_Node_method_get_tree_string>`, this returns the tree as a :ref:`String<class_String>`. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees.
  1215. \ **Example output:**\
  1216. ::
  1217. ┖╴TheGame
  1218. ┠╴Menu
  1219. ┃ ┠╴Label
  1220. ┃ ┖╴Camera2D
  1221. ┖╴SplashScreen
  1222. ┖╴Camera2D
  1223. .. rst-class:: classref-item-separator
  1224. ----
  1225. .. _class_Node_method_get_viewport:
  1226. .. rst-class:: classref-method
  1227. :ref:`Viewport<class_Viewport>` **get_viewport**\ (\ ) |const|
  1228. Returns the node's closest :ref:`Viewport<class_Viewport>` ancestor, if the node is inside the tree. Otherwise, returns ``null``.
  1229. .. rst-class:: classref-item-separator
  1230. ----
  1231. .. _class_Node_method_get_window:
  1232. .. rst-class:: classref-method
  1233. :ref:`Window<class_Window>` **get_window**\ (\ ) |const|
  1234. Returns the :ref:`Window<class_Window>` that contains this node. If the node is in the main window, this is equivalent to getting the root node (``get_tree().get_root()``).
  1235. .. rst-class:: classref-item-separator
  1236. ----
  1237. .. _class_Node_method_has_node:
  1238. .. rst-class:: classref-method
  1239. :ref:`bool<class_bool>` **has_node**\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |const|
  1240. Returns ``true`` if the ``path`` points to a valid node. See also :ref:`get_node<class_Node_method_get_node>`.
  1241. .. rst-class:: classref-item-separator
  1242. ----
  1243. .. _class_Node_method_has_node_and_resource:
  1244. .. rst-class:: classref-method
  1245. :ref:`bool<class_bool>` **has_node_and_resource**\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |const|
  1246. Returns ``true`` if ``path`` points to a valid node and its subnames point to a valid :ref:`Resource<class_Resource>`, e.g. ``Area2D/CollisionShape2D:shape``. Properties that are not :ref:`Resource<class_Resource>` types (such as nodes or other :ref:`Variant<class_Variant>` types) are not considered. See also :ref:`get_node_and_resource<class_Node_method_get_node_and_resource>`.
  1247. .. rst-class:: classref-item-separator
  1248. ----
  1249. .. _class_Node_method_is_ancestor_of:
  1250. .. rst-class:: classref-method
  1251. :ref:`bool<class_bool>` **is_ancestor_of**\ (\ node\: :ref:`Node<class_Node>`\ ) |const|
  1252. Returns ``true`` if the given ``node`` is a direct or indirect child of this node.
  1253. .. rst-class:: classref-item-separator
  1254. ----
  1255. .. _class_Node_method_is_displayed_folded:
  1256. .. rst-class:: classref-method
  1257. :ref:`bool<class_bool>` **is_displayed_folded**\ (\ ) |const|
  1258. Returns ``true`` if the node is folded (collapsed) in the Scene dock. This method is intended to be used in editor plugins and tools. See also :ref:`set_display_folded<class_Node_method_set_display_folded>`.
  1259. .. rst-class:: classref-item-separator
  1260. ----
  1261. .. _class_Node_method_is_editable_instance:
  1262. .. rst-class:: classref-method
  1263. :ref:`bool<class_bool>` **is_editable_instance**\ (\ node\: :ref:`Node<class_Node>`\ ) |const|
  1264. Returns ``true`` if ``node`` has editable children enabled relative to this node. This method is intended to be used in editor plugins and tools. See also :ref:`set_editable_instance<class_Node_method_set_editable_instance>`.
  1265. .. rst-class:: classref-item-separator
  1266. ----
  1267. .. _class_Node_method_is_greater_than:
  1268. .. rst-class:: classref-method
  1269. :ref:`bool<class_bool>` **is_greater_than**\ (\ node\: :ref:`Node<class_Node>`\ ) |const|
  1270. Returns ``true`` if the given ``node`` occurs later in the scene hierarchy than this node. A node occurring later is usually processed last.
  1271. .. rst-class:: classref-item-separator
  1272. ----
  1273. .. _class_Node_method_is_in_group:
  1274. .. rst-class:: classref-method
  1275. :ref:`bool<class_bool>` **is_in_group**\ (\ group\: :ref:`StringName<class_StringName>`\ ) |const|
  1276. Returns ``true`` if this node has been added to the given ``group``. See :ref:`add_to_group<class_Node_method_add_to_group>` and :ref:`remove_from_group<class_Node_method_remove_from_group>`. See also notes in the description, and the :ref:`SceneTree<class_SceneTree>`'s group methods.
  1277. .. rst-class:: classref-item-separator
  1278. ----
  1279. .. _class_Node_method_is_inside_tree:
  1280. .. rst-class:: classref-method
  1281. :ref:`bool<class_bool>` **is_inside_tree**\ (\ ) |const|
  1282. Returns ``true`` if this node is currently inside a :ref:`SceneTree<class_SceneTree>`. See also :ref:`get_tree<class_Node_method_get_tree>`.
  1283. .. rst-class:: classref-item-separator
  1284. ----
  1285. .. _class_Node_method_is_multiplayer_authority:
  1286. .. rst-class:: classref-method
  1287. :ref:`bool<class_bool>` **is_multiplayer_authority**\ (\ ) |const|
  1288. Returns ``true`` if the local system is the multiplayer authority of this node.
  1289. .. rst-class:: classref-item-separator
  1290. ----
  1291. .. _class_Node_method_is_node_ready:
  1292. .. rst-class:: classref-method
  1293. :ref:`bool<class_bool>` **is_node_ready**\ (\ ) |const|
  1294. Returns ``true`` if the node is ready, i.e. it's inside scene tree and all its children are initialized.
  1295. \ :ref:`request_ready<class_Node_method_request_ready>` resets it back to ``false``.
  1296. .. rst-class:: classref-item-separator
  1297. ----
  1298. .. _class_Node_method_is_physics_processing:
  1299. .. rst-class:: classref-method
  1300. :ref:`bool<class_bool>` **is_physics_processing**\ (\ ) |const|
  1301. Returns ``true`` if physics processing is enabled (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  1302. .. rst-class:: classref-item-separator
  1303. ----
  1304. .. _class_Node_method_is_physics_processing_internal:
  1305. .. rst-class:: classref-method
  1306. :ref:`bool<class_bool>` **is_physics_processing_internal**\ (\ ) |const|
  1307. Returns ``true`` if internal physics processing is enabled (see :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>`).
  1308. .. rst-class:: classref-item-separator
  1309. ----
  1310. .. _class_Node_method_is_processing:
  1311. .. rst-class:: classref-method
  1312. :ref:`bool<class_bool>` **is_processing**\ (\ ) |const|
  1313. Returns ``true`` if processing is enabled (see :ref:`set_process<class_Node_method_set_process>`).
  1314. .. rst-class:: classref-item-separator
  1315. ----
  1316. .. _class_Node_method_is_processing_input:
  1317. .. rst-class:: classref-method
  1318. :ref:`bool<class_bool>` **is_processing_input**\ (\ ) |const|
  1319. Returns ``true`` if the node is processing input (see :ref:`set_process_input<class_Node_method_set_process_input>`).
  1320. .. rst-class:: classref-item-separator
  1321. ----
  1322. .. _class_Node_method_is_processing_internal:
  1323. .. rst-class:: classref-method
  1324. :ref:`bool<class_bool>` **is_processing_internal**\ (\ ) |const|
  1325. Returns ``true`` if internal processing is enabled (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  1326. .. rst-class:: classref-item-separator
  1327. ----
  1328. .. _class_Node_method_is_processing_shortcut_input:
  1329. .. rst-class:: classref-method
  1330. :ref:`bool<class_bool>` **is_processing_shortcut_input**\ (\ ) |const|
  1331. Returns ``true`` if the node is processing shortcuts (see :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>`).
  1332. .. rst-class:: classref-item-separator
  1333. ----
  1334. .. _class_Node_method_is_processing_unhandled_input:
  1335. .. rst-class:: classref-method
  1336. :ref:`bool<class_bool>` **is_processing_unhandled_input**\ (\ ) |const|
  1337. Returns ``true`` if the node is processing unhandled input (see :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>`).
  1338. .. rst-class:: classref-item-separator
  1339. ----
  1340. .. _class_Node_method_is_processing_unhandled_key_input:
  1341. .. rst-class:: classref-method
  1342. :ref:`bool<class_bool>` **is_processing_unhandled_key_input**\ (\ ) |const|
  1343. Returns ``true`` if the node is processing unhandled key input (see :ref:`set_process_unhandled_key_input<class_Node_method_set_process_unhandled_key_input>`).
  1344. .. rst-class:: classref-item-separator
  1345. ----
  1346. .. _class_Node_method_move_child:
  1347. .. rst-class:: classref-method
  1348. |void| **move_child**\ (\ child_node\: :ref:`Node<class_Node>`, to_index\: :ref:`int<class_int>`\ )
  1349. Moves ``child_node`` to the given index. A node's index is the order among its siblings. If ``to_index`` is negative, the index is counted from the end of the list. See also :ref:`get_child<class_Node_method_get_child>` and :ref:`get_index<class_Node_method_get_index>`.
  1350. \ **Note:** The processing order of several engine callbacks (:ref:`_ready<class_Node_private_method__ready>`, :ref:`_process<class_Node_private_method__process>`, etc.) and notifications sent through :ref:`propagate_notification<class_Node_method_propagate_notification>` is affected by tree order. :ref:`CanvasItem<class_CanvasItem>` nodes are also rendered in tree order. See also :ref:`process_priority<class_Node_property_process_priority>`.
  1351. .. rst-class:: classref-item-separator
  1352. ----
  1353. .. _class_Node_method_notify_deferred_thread_group:
  1354. .. rst-class:: classref-method
  1355. |void| **notify_deferred_thread_group**\ (\ what\: :ref:`int<class_int>`\ )
  1356. Similar to :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>`, but for notifications.
  1357. .. rst-class:: classref-item-separator
  1358. ----
  1359. .. _class_Node_method_notify_thread_safe:
  1360. .. rst-class:: classref-method
  1361. |void| **notify_thread_safe**\ (\ what\: :ref:`int<class_int>`\ )
  1362. Similar to :ref:`call_thread_safe<class_Node_method_call_thread_safe>`, but for notifications.
  1363. .. rst-class:: classref-item-separator
  1364. ----
  1365. .. _class_Node_method_print_orphan_nodes:
  1366. .. rst-class:: classref-method
  1367. |void| **print_orphan_nodes**\ (\ ) |static|
  1368. Prints all orphan nodes (nodes outside the :ref:`SceneTree<class_SceneTree>`). Useful for debugging.
  1369. \ **Note:** This method only works in debug builds. Does nothing in a project exported in release mode.
  1370. .. rst-class:: classref-item-separator
  1371. ----
  1372. .. _class_Node_method_print_tree:
  1373. .. rst-class:: classref-method
  1374. |void| **print_tree**\ (\ )
  1375. Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs :ref:`NodePath<class_NodePath>`\ s relative to this node, and is good for copy/pasting into :ref:`get_node<class_Node_method_get_node>`. See also :ref:`print_tree_pretty<class_Node_method_print_tree_pretty>`.
  1376. \ **Example output:**\
  1377. ::
  1378. .
  1379. Menu
  1380. Menu/Label
  1381. Menu/Camera2D
  1382. SplashScreen
  1383. SplashScreen/Camera2D
  1384. .. rst-class:: classref-item-separator
  1385. ----
  1386. .. _class_Node_method_print_tree_pretty:
  1387. .. rst-class:: classref-method
  1388. |void| **print_tree_pretty**\ (\ )
  1389. Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to :ref:`print_tree<class_Node_method_print_tree>`, but the graphical representation looks like what is displayed in the editor's Scene dock. It is useful for inspecting larger trees.
  1390. \ **Example output:**\
  1391. ::
  1392. ┖╴TheGame
  1393. ┠╴Menu
  1394. ┃ ┠╴Label
  1395. ┃ ┖╴Camera2D
  1396. ┖╴SplashScreen
  1397. ┖╴Camera2D
  1398. .. rst-class:: classref-item-separator
  1399. ----
  1400. .. _class_Node_method_propagate_call:
  1401. .. rst-class:: classref-method
  1402. |void| **propagate_call**\ (\ method\: :ref:`StringName<class_StringName>`, args\: :ref:`Array<class_Array>` = [], parent_first\: :ref:`bool<class_bool>` = false\ )
  1403. Calls the given ``method`` name, passing ``args`` as arguments, on this node and all of its children, recursively.
  1404. If ``parent_first`` is ``true``, the method is called on this node first, then on all of its children. If ``false``, the children's methods are called first.
  1405. .. rst-class:: classref-item-separator
  1406. ----
  1407. .. _class_Node_method_propagate_notification:
  1408. .. rst-class:: classref-method
  1409. |void| **propagate_notification**\ (\ what\: :ref:`int<class_int>`\ )
  1410. Calls :ref:`Object.notification<class_Object_method_notification>` with ``what`` on this node and all of its children, recursively.
  1411. .. rst-class:: classref-item-separator
  1412. ----
  1413. .. _class_Node_method_queue_free:
  1414. .. rst-class:: classref-method
  1415. |void| **queue_free**\ (\ )
  1416. Queues this node to be deleted at the end of the current frame. When deleted, all of its children are deleted as well, and all references to the node and its children become invalid.
  1417. Unlike with :ref:`Object.free<class_Object_method_free>`, the node is not deleted instantly, and it can still be accessed before deletion. It is also safe to call :ref:`queue_free<class_Node_method_queue_free>` multiple times. Use :ref:`Object.is_queued_for_deletion<class_Object_method_is_queued_for_deletion>` to check if the node will be deleted at the end of the frame.
  1418. \ **Note:** The node will only be freed after all other deferred calls are finished. Using this method is not always the same as calling :ref:`Object.free<class_Object_method_free>` through :ref:`Object.call_deferred<class_Object_method_call_deferred>`.
  1419. .. rst-class:: classref-item-separator
  1420. ----
  1421. .. _class_Node_method_remove_child:
  1422. .. rst-class:: classref-method
  1423. |void| **remove_child**\ (\ node\: :ref:`Node<class_Node>`\ )
  1424. Removes a child ``node``. The ``node``, along with its children, are **not** deleted. To delete a node, see :ref:`queue_free<class_Node_method_queue_free>`.
  1425. \ **Note:** When this node is inside the tree, this method sets the :ref:`owner<class_Node_property_owner>` of the removed ``node`` (or its descendants) to ``null``, if their :ref:`owner<class_Node_property_owner>` is no longer an ancestor (see :ref:`is_ancestor_of<class_Node_method_is_ancestor_of>`).
  1426. .. rst-class:: classref-item-separator
  1427. ----
  1428. .. _class_Node_method_remove_from_group:
  1429. .. rst-class:: classref-method
  1430. |void| **remove_from_group**\ (\ group\: :ref:`StringName<class_StringName>`\ )
  1431. Removes the node from the given ``group``. Does nothing if the node is not in the ``group``. See also notes in the description, and the :ref:`SceneTree<class_SceneTree>`'s group methods.
  1432. .. rst-class:: classref-item-separator
  1433. ----
  1434. .. _class_Node_method_reparent:
  1435. .. rst-class:: classref-method
  1436. |void| **reparent**\ (\ new_parent\: :ref:`Node<class_Node>`, keep_global_transform\: :ref:`bool<class_bool>` = true\ )
  1437. Changes the parent of this **Node** to the ``new_parent``. The node needs to already have a parent. The node's :ref:`owner<class_Node_property_owner>` is preserved if its owner is still reachable from the new location (i.e., the node is still a descendant of the new parent after the operation).
  1438. If ``keep_global_transform`` is ``true``, the node's global transform will be preserved if supported. :ref:`Node2D<class_Node2D>`, :ref:`Node3D<class_Node3D>` and :ref:`Control<class_Control>` support this argument (but :ref:`Control<class_Control>` keeps only position).
  1439. .. rst-class:: classref-item-separator
  1440. ----
  1441. .. _class_Node_method_replace_by:
  1442. .. rst-class:: classref-method
  1443. |void| **replace_by**\ (\ node\: :ref:`Node<class_Node>`, keep_groups\: :ref:`bool<class_bool>` = false\ )
  1444. Replaces this node by the given ``node``. All children of this node are moved to ``node``.
  1445. If ``keep_groups`` is ``true``, the ``node`` is added to the same groups that the replaced node is in (see :ref:`add_to_group<class_Node_method_add_to_group>`).
  1446. \ **Warning:** The replaced node is removed from the tree, but it is **not** deleted. To prevent memory leaks, store a reference to the node in a variable, or use :ref:`Object.free<class_Object_method_free>`.
  1447. .. rst-class:: classref-item-separator
  1448. ----
  1449. .. _class_Node_method_request_ready:
  1450. .. rst-class:: classref-method
  1451. |void| **request_ready**\ (\ )
  1452. Requests :ref:`_ready<class_Node_private_method__ready>` to be called again the next time the node enters the tree. Does **not** immediately call :ref:`_ready<class_Node_private_method__ready>`.
  1453. \ **Note:** This method only affects the current node. If the node's children also need to request ready, this method needs to be called for each one of them. When the node and its children enter the tree again, the order of :ref:`_ready<class_Node_private_method__ready>` callbacks will be the same as normal.
  1454. .. rst-class:: classref-item-separator
  1455. ----
  1456. .. _class_Node_method_rpc:
  1457. .. rst-class:: classref-method
  1458. :ref:`Error<enum_@GlobalScope_Error>` **rpc**\ (\ method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg|
  1459. Sends a remote procedure call request for the given ``method`` to peers on the network (and locally), sending additional arguments to the method called by the RPC. The call request will only be received by nodes with the same :ref:`NodePath<class_NodePath>`, including the exact same :ref:`name<class_Node_property_name>`. Behavior depends on the RPC configuration for the given ``method`` (see :ref:`rpc_config<class_Node_method_rpc_config>` and :ref:`@GDScript.@rpc<class_@GDScript_annotation_@rpc>`). By default, methods are not exposed to RPCs.
  1460. May return :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` if the call is successful, :ref:`@GlobalScope.ERR_INVALID_PARAMETER<class_@GlobalScope_constant_ERR_INVALID_PARAMETER>` if the arguments passed in the ``method`` do not match, :ref:`@GlobalScope.ERR_UNCONFIGURED<class_@GlobalScope_constant_ERR_UNCONFIGURED>` if the node's :ref:`multiplayer<class_Node_property_multiplayer>` cannot be fetched (such as when the node is not inside the tree), :ref:`@GlobalScope.ERR_CONNECTION_ERROR<class_@GlobalScope_constant_ERR_CONNECTION_ERROR>` if :ref:`multiplayer<class_Node_property_multiplayer>`'s connection is not available.
  1461. \ **Note:** You can only safely use RPCs on clients after you received the :ref:`MultiplayerAPI.connected_to_server<class_MultiplayerAPI_signal_connected_to_server>` signal from the :ref:`MultiplayerAPI<class_MultiplayerAPI>`. You also need to keep track of the connection state, either by the :ref:`MultiplayerAPI<class_MultiplayerAPI>` signals like :ref:`MultiplayerAPI.server_disconnected<class_MultiplayerAPI_signal_server_disconnected>` or by checking (``get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED``).
  1462. .. rst-class:: classref-item-separator
  1463. ----
  1464. .. _class_Node_method_rpc_config:
  1465. .. rst-class:: classref-method
  1466. |void| **rpc_config**\ (\ method\: :ref:`StringName<class_StringName>`, config\: :ref:`Variant<class_Variant>`\ )
  1467. Changes the RPC configuration for the given ``method``. ``config`` should either be ``null`` to disable the feature (as by default), or a :ref:`Dictionary<class_Dictionary>` containing the following entries:
  1468. - ``rpc_mode``: see :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>`;
  1469. - ``transfer_mode``: see :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>`;
  1470. - ``call_local``: if ``true``, the method will also be called locally;
  1471. - ``channel``: an :ref:`int<class_int>` representing the channel to send the RPC on.
  1472. \ **Note:** In GDScript, this method corresponds to the :ref:`@GDScript.@rpc<class_@GDScript_annotation_@rpc>` annotation, with various parameters passed (``@rpc(any)``, ``@rpc(authority)``...). See also the :doc:`high-level multiplayer <../tutorials/networking/high_level_multiplayer>` tutorial.
  1473. .. rst-class:: classref-item-separator
  1474. ----
  1475. .. _class_Node_method_rpc_id:
  1476. .. rst-class:: classref-method
  1477. :ref:`Error<enum_@GlobalScope_Error>` **rpc_id**\ (\ peer_id\: :ref:`int<class_int>`, method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg|
  1478. Sends a :ref:`rpc<class_Node_method_rpc>` to a specific peer identified by ``peer_id`` (see :ref:`MultiplayerPeer.set_target_peer<class_MultiplayerPeer_method_set_target_peer>`).
  1479. May return :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` if the call is successful, :ref:`@GlobalScope.ERR_INVALID_PARAMETER<class_@GlobalScope_constant_ERR_INVALID_PARAMETER>` if the arguments passed in the ``method`` do not match, :ref:`@GlobalScope.ERR_UNCONFIGURED<class_@GlobalScope_constant_ERR_UNCONFIGURED>` if the node's :ref:`multiplayer<class_Node_property_multiplayer>` cannot be fetched (such as when the node is not inside the tree), :ref:`@GlobalScope.ERR_CONNECTION_ERROR<class_@GlobalScope_constant_ERR_CONNECTION_ERROR>` if :ref:`multiplayer<class_Node_property_multiplayer>`'s connection is not available.
  1480. .. rst-class:: classref-item-separator
  1481. ----
  1482. .. _class_Node_method_set_deferred_thread_group:
  1483. .. rst-class:: classref-method
  1484. |void| **set_deferred_thread_group**\ (\ property\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ )
  1485. Similar to :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>`, but for setting properties.
  1486. .. rst-class:: classref-item-separator
  1487. ----
  1488. .. _class_Node_method_set_display_folded:
  1489. .. rst-class:: classref-method
  1490. |void| **set_display_folded**\ (\ fold\: :ref:`bool<class_bool>`\ )
  1491. If set to ``true``, the node appears folded in the Scene dock. As a result, all of its children are hidden. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also :ref:`is_displayed_folded<class_Node_method_is_displayed_folded>`.
  1492. .. rst-class:: classref-item-separator
  1493. ----
  1494. .. _class_Node_method_set_editable_instance:
  1495. .. rst-class:: classref-method
  1496. |void| **set_editable_instance**\ (\ node\: :ref:`Node<class_Node>`, is_editable\: :ref:`bool<class_bool>`\ )
  1497. Set to ``true`` to allow all nodes owned by ``node`` to be available, and editable, in the Scene dock, even if their :ref:`owner<class_Node_property_owner>` is not the scene root. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also :ref:`is_editable_instance<class_Node_method_is_editable_instance>`.
  1498. .. rst-class:: classref-item-separator
  1499. ----
  1500. .. _class_Node_method_set_multiplayer_authority:
  1501. .. rst-class:: classref-method
  1502. |void| **set_multiplayer_authority**\ (\ id\: :ref:`int<class_int>`, recursive\: :ref:`bool<class_bool>` = true\ )
  1503. Sets the node's multiplayer authority to the peer with the given peer ``id``. The multiplayer authority is the peer that has authority over the node on the network. Defaults to peer ID 1 (the server). Useful in conjunction with :ref:`rpc_config<class_Node_method_rpc_config>` and the :ref:`MultiplayerAPI<class_MultiplayerAPI>`.
  1504. If ``recursive`` is ``true``, the given peer is recursively set as the authority for all children of this node.
  1505. \ **Warning:** This does **not** automatically replicate the new authority to other peers. It is the developer's responsibility to do so. You may replicate the new authority's information using :ref:`MultiplayerSpawner.spawn_function<class_MultiplayerSpawner_property_spawn_function>`, an RPC, or a :ref:`MultiplayerSynchronizer<class_MultiplayerSynchronizer>`. Furthermore, the parent's authority does **not** propagate to newly added children.
  1506. .. rst-class:: classref-item-separator
  1507. ----
  1508. .. _class_Node_method_set_physics_process:
  1509. .. rst-class:: classref-method
  1510. |void| **set_physics_process**\ (\ enable\: :ref:`bool<class_bool>`\ )
  1511. If set to ``true``, enables physics (fixed framerate) processing. When a node is being processed, it will receive a :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` at a fixed (usually 60 FPS, see :ref:`Engine.physics_ticks_per_second<class_Engine_property_physics_ticks_per_second>` to change) interval (and the :ref:`_physics_process<class_Node_private_method__physics_process>` callback will be called if it exists).
  1512. \ **Note:** If :ref:`_physics_process<class_Node_private_method__physics_process>` is overridden, this will be automatically enabled before :ref:`_ready<class_Node_private_method__ready>` is called.
  1513. .. rst-class:: classref-item-separator
  1514. ----
  1515. .. _class_Node_method_set_physics_process_internal:
  1516. .. rst-class:: classref-method
  1517. |void| **set_physics_process_internal**\ (\ enable\: :ref:`bool<class_bool>`\ )
  1518. If set to ``true``, enables internal physics for this node. Internal physics processing happens in isolation from the normal :ref:`_physics_process<class_Node_private_method__physics_process>` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting (:ref:`set_physics_process<class_Node_method_set_physics_process>`).
  1519. \ **Warning:** Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing.
  1520. .. rst-class:: classref-item-separator
  1521. ----
  1522. .. _class_Node_method_set_process:
  1523. .. rst-class:: classref-method
  1524. |void| **set_process**\ (\ enable\: :ref:`bool<class_bool>`\ )
  1525. If set to ``true``, enables processing. When a node is being processed, it will receive a :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>` on every drawn frame (and the :ref:`_process<class_Node_private_method__process>` callback will be called if it exists).
  1526. \ **Note:** If :ref:`_process<class_Node_private_method__process>` is overridden, this will be automatically enabled before :ref:`_ready<class_Node_private_method__ready>` is called.
  1527. \ **Note:** This method only affects the :ref:`_process<class_Node_private_method__process>` callback, i.e. it has no effect on other callbacks like :ref:`_physics_process<class_Node_private_method__physics_process>`. If you want to disable all processing for the node, set :ref:`process_mode<class_Node_property_process_mode>` to :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  1528. .. rst-class:: classref-item-separator
  1529. ----
  1530. .. _class_Node_method_set_process_input:
  1531. .. rst-class:: classref-method
  1532. |void| **set_process_input**\ (\ enable\: :ref:`bool<class_bool>`\ )
  1533. If set to ``true``, enables input processing.
  1534. \ **Note:** If :ref:`_input<class_Node_private_method__input>` is overridden, this will be automatically enabled before :ref:`_ready<class_Node_private_method__ready>` is called. Input processing is also already enabled for GUI controls, such as :ref:`Button<class_Button>` and :ref:`TextEdit<class_TextEdit>`.
  1535. .. rst-class:: classref-item-separator
  1536. ----
  1537. .. _class_Node_method_set_process_internal:
  1538. .. rst-class:: classref-method
  1539. |void| **set_process_internal**\ (\ enable\: :ref:`bool<class_bool>`\ )
  1540. If set to ``true``, enables internal processing for this node. Internal processing happens in isolation from the normal :ref:`_process<class_Node_private_method__process>` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting (:ref:`set_process<class_Node_method_set_process>`).
  1541. \ **Warning:** Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing.
  1542. .. rst-class:: classref-item-separator
  1543. ----
  1544. .. _class_Node_method_set_process_shortcut_input:
  1545. .. rst-class:: classref-method
  1546. |void| **set_process_shortcut_input**\ (\ enable\: :ref:`bool<class_bool>`\ )
  1547. If set to ``true``, enables shortcut processing for this node.
  1548. \ **Note:** If :ref:`_shortcut_input<class_Node_private_method__shortcut_input>` is overridden, this will be automatically enabled before :ref:`_ready<class_Node_private_method__ready>` is called.
  1549. .. rst-class:: classref-item-separator
  1550. ----
  1551. .. _class_Node_method_set_process_unhandled_input:
  1552. .. rst-class:: classref-method
  1553. |void| **set_process_unhandled_input**\ (\ enable\: :ref:`bool<class_bool>`\ )
  1554. If set to ``true``, enables unhandled input processing. It enables the node to receive all input that was not previously handled (usually by a :ref:`Control<class_Control>`).
  1555. \ **Note:** If :ref:`_unhandled_input<class_Node_private_method__unhandled_input>` is overridden, this will be automatically enabled before :ref:`_ready<class_Node_private_method__ready>` is called. Unhandled input processing is also already enabled for GUI controls, such as :ref:`Button<class_Button>` and :ref:`TextEdit<class_TextEdit>`.
  1556. .. rst-class:: classref-item-separator
  1557. ----
  1558. .. _class_Node_method_set_process_unhandled_key_input:
  1559. .. rst-class:: classref-method
  1560. |void| **set_process_unhandled_key_input**\ (\ enable\: :ref:`bool<class_bool>`\ )
  1561. If set to ``true``, enables unhandled key input processing.
  1562. \ **Note:** If :ref:`_unhandled_key_input<class_Node_private_method__unhandled_key_input>` is overridden, this will be automatically enabled before :ref:`_ready<class_Node_private_method__ready>` is called.
  1563. .. rst-class:: classref-item-separator
  1564. ----
  1565. .. _class_Node_method_set_scene_instance_load_placeholder:
  1566. .. rst-class:: classref-method
  1567. |void| **set_scene_instance_load_placeholder**\ (\ load_placeholder\: :ref:`bool<class_bool>`\ )
  1568. If set to ``true``, the node becomes a :ref:`InstancePlaceholder<class_InstancePlaceholder>` when packed and instantiated from a :ref:`PackedScene<class_PackedScene>`. See also :ref:`get_scene_instance_load_placeholder<class_Node_method_get_scene_instance_load_placeholder>`.
  1569. .. rst-class:: classref-item-separator
  1570. ----
  1571. .. _class_Node_method_set_thread_safe:
  1572. .. rst-class:: classref-method
  1573. |void| **set_thread_safe**\ (\ property\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ )
  1574. Similar to :ref:`call_thread_safe<class_Node_method_call_thread_safe>`, but for setting properties.
  1575. .. rst-class:: classref-item-separator
  1576. ----
  1577. .. _class_Node_method_update_configuration_warnings:
  1578. .. rst-class:: classref-method
  1579. |void| **update_configuration_warnings**\ (\ )
  1580. Refreshes the warnings displayed for this node in the Scene dock. Use :ref:`_get_configuration_warnings<class_Node_private_method__get_configuration_warnings>` to customize the warning messages to display.
  1581. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1582. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1583. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1584. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1585. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1586. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1587. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1588. .. |void| replace:: :abbr:`void (No return value.)`