2
0

class_node.rst 150 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637
  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/4.1/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.1/doc/classes/Node.xml.
  6. .. _class_Node:
  7. Node
  8. ====
  9. **Inherits:** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`AnimationPlayer<class_AnimationPlayer>`, :ref:`AnimationTree<class_AnimationTree>`, :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:`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_method__enter_tree>` callback is triggered. Child nodes are always added *after* their parent node, i.e. the :ref:`_enter_tree<class_Node_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_method__ready>` callbacks are triggered. For groups of nodes, the :ref:`_ready<class_Node_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_method__enter_tree>` of the parent, :ref:`_enter_tree<class_Node_method__enter_tree>` of the children, :ref:`_ready<class_Node_method__ready>` of the children and finally :ref:`_ready<class_Node_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_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_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_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_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 instancing 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 (``set_script()`` and ``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:`String<class_String>` | :ref:`editor_description<class_Node_property_editor_description>` | ``""`` |
  39. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  40. | :ref:`MultiplayerAPI<class_MultiplayerAPI>` | :ref:`multiplayer<class_Node_property_multiplayer>` | |
  41. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  42. | :ref:`StringName<class_StringName>` | :ref:`name<class_Node_property_name>` | |
  43. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  44. | :ref:`Node<class_Node>` | :ref:`owner<class_Node_property_owner>` | |
  45. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  46. | :ref:`ProcessMode<enum_Node_ProcessMode>` | :ref:`process_mode<class_Node_property_process_mode>` | ``0`` |
  47. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  48. | :ref:`int<class_int>` | :ref:`process_physics_priority<class_Node_property_process_physics_priority>` | ``0`` |
  49. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  50. | :ref:`int<class_int>` | :ref:`process_priority<class_Node_property_process_priority>` | ``0`` |
  51. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  52. | :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` | :ref:`process_thread_group<class_Node_property_process_thread_group>` | ``0`` |
  53. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  54. | :ref:`int<class_int>` | :ref:`process_thread_group_order<class_Node_property_process_thread_group_order>` | |
  55. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  56. | |bitfield|\<:ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>`\> | :ref:`process_thread_messages<class_Node_property_process_thread_messages>` | |
  57. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  58. | :ref:`String<class_String>` | :ref:`scene_file_path<class_Node_property_scene_file_path>` | |
  59. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  60. | :ref:`bool<class_bool>` | :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>` | ``false`` |
  61. +-----------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  62. .. rst-class:: classref-reftable-group
  63. Methods
  64. -------
  65. .. table::
  66. :widths: auto
  67. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`_enter_tree<class_Node_method__enter_tree>` **(** **)** |virtual| |
  69. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`_exit_tree<class_Node_method__exit_tree>` **(** **)** |virtual| |
  71. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_configuration_warnings<class_Node_method__get_configuration_warnings>` **(** **)** |virtual| |const| |
  73. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`_input<class_Node_method__input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  75. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`_physics_process<class_Node_method__physics_process>` **(** :ref:`float<class_float>` delta **)** |virtual| |
  77. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`_process<class_Node_method__process>` **(** :ref:`float<class_float>` delta **)** |virtual| |
  79. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`_ready<class_Node_method__ready>` **(** **)** |virtual| |
  81. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`_shortcut_input<class_Node_method__shortcut_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  83. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`_unhandled_input<class_Node_method__unhandled_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  85. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  87. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`add_child<class_Node_method_add_child>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` force_readable_name=false, :ref:`InternalMode<enum_Node_InternalMode>` internal=0 **)** |
  89. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`add_sibling<class_Node_method_add_sibling>` **(** :ref:`Node<class_Node>` sibling, :ref:`bool<class_bool>` force_readable_name=false **)** |
  91. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`add_to_group<class_Node_method_add_to_group>` **(** :ref:`StringName<class_StringName>` group, :ref:`bool<class_bool>` persistent=false **)** |
  93. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Variant<class_Variant>` | :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>` **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  95. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`Variant<class_Variant>` | :ref:`call_thread_safe<class_Node_method_call_thread_safe>` **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  97. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`can_process<class_Node_method_can_process>` **(** **)** |const| |
  99. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Tween<class_Tween>` | :ref:`create_tween<class_Node_method_create_tween>` **(** **)** |
  101. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`Node<class_Node>` | :ref:`duplicate<class_Node_method_duplicate>` **(** :ref:`int<class_int>` flags=15 **)** |const| |
  103. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`Node<class_Node>` | :ref:`find_child<class_Node_method_find_child>` **(** :ref:`String<class_String>` pattern, :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const| |
  105. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`Node[]<class_Node>` | :ref:`find_children<class_Node_method_find_children>` **(** :ref:`String<class_String>` pattern, :ref:`String<class_String>` type="", :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const| |
  107. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Node<class_Node>` | :ref:`find_parent<class_Node_method_find_parent>` **(** :ref:`String<class_String>` pattern **)** |const| |
  109. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`Node<class_Node>` | :ref:`get_child<class_Node_method_get_child>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` include_internal=false **)** |const| |
  111. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`int<class_int>` | :ref:`get_child_count<class_Node_method_get_child_count>` **(** :ref:`bool<class_bool>` include_internal=false **)** |const| |
  113. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`Node[]<class_Node>` | :ref:`get_children<class_Node_method_get_children>` **(** :ref:`bool<class_bool>` include_internal=false **)** |const| |
  115. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`StringName[]<class_StringName>` | :ref:`get_groups<class_Node_method_get_groups>` **(** **)** |const| |
  117. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`int<class_int>` | :ref:`get_index<class_Node_method_get_index>` **(** :ref:`bool<class_bool>` include_internal=false **)** |const| |
  119. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`Window<class_Window>` | :ref:`get_last_exclusive_window<class_Node_method_get_last_exclusive_window>` **(** **)** |const| |
  121. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`int<class_int>` | :ref:`get_multiplayer_authority<class_Node_method_get_multiplayer_authority>` **(** **)** |const| |
  123. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`Node<class_Node>` | :ref:`get_node<class_Node_method_get_node>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  125. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`Array<class_Array>` | :ref:`get_node_and_resource<class_Node_method_get_node_and_resource>` **(** :ref:`NodePath<class_NodePath>` path **)** |
  127. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`Node<class_Node>` | :ref:`get_node_or_null<class_Node_method_get_node_or_null>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  129. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Node<class_Node>` | :ref:`get_parent<class_Node_method_get_parent>` **(** **)** |const| |
  131. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`NodePath<class_NodePath>` | :ref:`get_path<class_Node_method_get_path>` **(** **)** |const| |
  133. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`NodePath<class_NodePath>` | :ref:`get_path_to<class_Node_method_get_path_to>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` use_unique_path=false **)** |const| |
  135. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`float<class_float>` | :ref:`get_physics_process_delta_time<class_Node_method_get_physics_process_delta_time>` **(** **)** |const| |
  137. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | :ref:`float<class_float>` | :ref:`get_process_delta_time<class_Node_method_get_process_delta_time>` **(** **)** |const| |
  139. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`bool<class_bool>` | :ref:`get_scene_instance_load_placeholder<class_Node_method_get_scene_instance_load_placeholder>` **(** **)** |const| |
  141. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | :ref:`SceneTree<class_SceneTree>` | :ref:`get_tree<class_Node_method_get_tree>` **(** **)** |const| |
  143. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`Viewport<class_Viewport>` | :ref:`get_viewport<class_Node_method_get_viewport>` **(** **)** |const| |
  145. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`Window<class_Window>` | :ref:`get_window<class_Node_method_get_window>` **(** **)** |const| |
  147. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`bool<class_bool>` | :ref:`has_node<class_Node_method_has_node>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  149. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`bool<class_bool>` | :ref:`has_node_and_resource<class_Node_method_has_node_and_resource>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  151. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | :ref:`bool<class_bool>` | :ref:`is_ancestor_of<class_Node_method_is_ancestor_of>` **(** :ref:`Node<class_Node>` node **)** |const| |
  153. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`bool<class_bool>` | :ref:`is_displayed_folded<class_Node_method_is_displayed_folded>` **(** **)** |const| |
  155. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`bool<class_bool>` | :ref:`is_editable_instance<class_Node_method_is_editable_instance>` **(** :ref:`Node<class_Node>` node **)** |const| |
  157. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`bool<class_bool>` | :ref:`is_greater_than<class_Node_method_is_greater_than>` **(** :ref:`Node<class_Node>` node **)** |const| |
  159. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`bool<class_bool>` | :ref:`is_in_group<class_Node_method_is_in_group>` **(** :ref:`StringName<class_StringName>` group **)** |const| |
  161. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`is_inside_tree<class_Node_method_is_inside_tree>` **(** **)** |const| |
  163. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`bool<class_bool>` | :ref:`is_multiplayer_authority<class_Node_method_is_multiplayer_authority>` **(** **)** |const| |
  165. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`bool<class_bool>` | :ref:`is_node_ready<class_Node_method_is_node_ready>` **(** **)** |const| |
  167. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`bool<class_bool>` | :ref:`is_physics_processing<class_Node_method_is_physics_processing>` **(** **)** |const| |
  169. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`bool<class_bool>` | :ref:`is_physics_processing_internal<class_Node_method_is_physics_processing_internal>` **(** **)** |const| |
  171. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`bool<class_bool>` | :ref:`is_processing<class_Node_method_is_processing>` **(** **)** |const| |
  173. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`bool<class_bool>` | :ref:`is_processing_input<class_Node_method_is_processing_input>` **(** **)** |const| |
  175. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :ref:`bool<class_bool>` | :ref:`is_processing_internal<class_Node_method_is_processing_internal>` **(** **)** |const| |
  177. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`bool<class_bool>` | :ref:`is_processing_shortcut_input<class_Node_method_is_processing_shortcut_input>` **(** **)** |const| |
  179. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`bool<class_bool>` | :ref:`is_processing_unhandled_input<class_Node_method_is_processing_unhandled_input>` **(** **)** |const| |
  181. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`bool<class_bool>` | :ref:`is_processing_unhandled_key_input<class_Node_method_is_processing_unhandled_key_input>` **(** **)** |const| |
  183. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`move_child<class_Node_method_move_child>` **(** :ref:`Node<class_Node>` child_node, :ref:`int<class_int>` to_index **)** |
  185. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`notify_deferred_thread_group<class_Node_method_notify_deferred_thread_group>` **(** :ref:`int<class_int>` what **)** |
  187. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`notify_thread_safe<class_Node_method_notify_thread_safe>` **(** :ref:`int<class_int>` what **)** |
  189. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | void | :ref:`print_orphan_nodes<class_Node_method_print_orphan_nodes>` **(** **)** |static| |
  191. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | void | :ref:`print_tree<class_Node_method_print_tree>` **(** **)** |
  193. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | void | :ref:`print_tree_pretty<class_Node_method_print_tree_pretty>` **(** **)** |
  195. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | void | :ref:`propagate_call<class_Node_method_propagate_call>` **(** :ref:`StringName<class_StringName>` method, :ref:`Array<class_Array>` args=[], :ref:`bool<class_bool>` parent_first=false **)** |
  197. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | void | :ref:`propagate_notification<class_Node_method_propagate_notification>` **(** :ref:`int<class_int>` what **)** |
  199. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | void | :ref:`queue_free<class_Node_method_queue_free>` **(** **)** |
  201. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | void | :ref:`remove_child<class_Node_method_remove_child>` **(** :ref:`Node<class_Node>` node **)** |
  203. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | void | :ref:`remove_from_group<class_Node_method_remove_from_group>` **(** :ref:`StringName<class_StringName>` group **)** |
  205. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | void | :ref:`reparent<class_Node_method_reparent>` **(** :ref:`Node<class_Node>` new_parent, :ref:`bool<class_bool>` keep_global_transform=true **)** |
  207. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | void | :ref:`replace_by<class_Node_method_replace_by>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` keep_groups=false **)** |
  209. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | void | :ref:`request_ready<class_Node_method_request_ready>` **(** **)** |
  211. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`rpc<class_Node_method_rpc>` **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  213. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | void | :ref:`rpc_config<class_Node_method_rpc_config>` **(** :ref:`StringName<class_StringName>` method, :ref:`Variant<class_Variant>` config **)** |
  215. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`rpc_id<class_Node_method_rpc_id>` **(** :ref:`int<class_int>` peer_id, :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  217. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | void | :ref:`set_deferred_thread_group<class_Node_method_set_deferred_thread_group>` **(** :ref:`StringName<class_StringName>` property, :ref:`Variant<class_Variant>` value **)** |
  219. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | void | :ref:`set_display_folded<class_Node_method_set_display_folded>` **(** :ref:`bool<class_bool>` fold **)** |
  221. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | void | :ref:`set_editable_instance<class_Node_method_set_editable_instance>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` is_editable **)** |
  223. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | void | :ref:`set_multiplayer_authority<class_Node_method_set_multiplayer_authority>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` recursive=true **)** |
  225. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | void | :ref:`set_physics_process<class_Node_method_set_physics_process>` **(** :ref:`bool<class_bool>` enable **)** |
  227. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | void | :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>` **(** :ref:`bool<class_bool>` enable **)** |
  229. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | void | :ref:`set_process<class_Node_method_set_process>` **(** :ref:`bool<class_bool>` enable **)** |
  231. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | void | :ref:`set_process_input<class_Node_method_set_process_input>` **(** :ref:`bool<class_bool>` enable **)** |
  233. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | void | :ref:`set_process_internal<class_Node_method_set_process_internal>` **(** :ref:`bool<class_bool>` enable **)** |
  235. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | void | :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>` **(** :ref:`bool<class_bool>` enable **)** |
  237. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | void | :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>` **(** :ref:`bool<class_bool>` enable **)** |
  239. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | void | :ref:`set_process_unhandled_key_input<class_Node_method_set_process_unhandled_key_input>` **(** :ref:`bool<class_bool>` enable **)** |
  241. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | void | :ref:`set_scene_instance_load_placeholder<class_Node_method_set_scene_instance_load_placeholder>` **(** :ref:`bool<class_bool>` load_placeholder **)** |
  243. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | void | :ref:`set_thread_safe<class_Node_method_set_thread_safe>` **(** :ref:`StringName<class_StringName>` property, :ref:`Variant<class_Variant>` value **)** |
  245. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | void | :ref:`update_configuration_warnings<class_Node_method_update_configuration_warnings>` **(** **)** |
  247. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. .. rst-class:: classref-section-separator
  249. ----
  250. .. rst-class:: classref-descriptions-group
  251. Signals
  252. -------
  253. .. _class_Node_signal_child_entered_tree:
  254. .. rst-class:: classref-signal
  255. **child_entered_tree** **(** :ref:`Node<class_Node>` node **)**
  256. Emitted when a child node enters the scene tree, either because it entered on its own or because this node entered with it.
  257. 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>`.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_Node_signal_child_exiting_tree:
  261. .. rst-class:: classref-signal
  262. **child_exiting_tree** **(** :ref:`Node<class_Node>` node **)**
  263. Emitted when a child node is about to exit the scene tree, either because it is being removed or freed directly, or because this node is exiting the tree.
  264. When this signal is received, the child ``node`` is still in the tree and valid. 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>`.
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_Node_signal_child_order_changed:
  268. .. rst-class:: classref-signal
  269. **child_order_changed** **(** **)**
  270. Emitted when the list of children is changed. This happens when child nodes are added, moved or removed.
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_Node_signal_ready:
  274. .. rst-class:: classref-signal
  275. **ready** **(** **)**
  276. Emitted when the node is ready. Comes after :ref:`_ready<class_Node_method__ready>` callback and follows the same rules.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _class_Node_signal_renamed:
  280. .. rst-class:: classref-signal
  281. **renamed** **(** **)**
  282. Emitted when the node is renamed.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_Node_signal_replacing_by:
  286. .. rst-class:: classref-signal
  287. **replacing_by** **(** :ref:`Node<class_Node>` node **)**
  288. Emitted when this node is being replaced by the ``node``, see :ref:`replace_by<class_Node_method_replace_by>`.
  289. 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``.
  290. .. rst-class:: classref-item-separator
  291. ----
  292. .. _class_Node_signal_tree_entered:
  293. .. rst-class:: classref-signal
  294. **tree_entered** **(** **)**
  295. Emitted when the node enters the tree.
  296. This signal is emitted *after* the related :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_Node_signal_tree_exited:
  300. .. rst-class:: classref-signal
  301. **tree_exited** **(** **)**
  302. Emitted after the node exits the tree and is no longer active.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_Node_signal_tree_exiting:
  306. .. rst-class:: classref-signal
  307. **tree_exiting** **(** **)**
  308. Emitted when the node is still active but about to exit the tree. This is the right place for de-initialization (or a "destructor", if you will).
  309. This signal is emitted *before* the related :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>` notification.
  310. .. rst-class:: classref-section-separator
  311. ----
  312. .. rst-class:: classref-descriptions-group
  313. Enumerations
  314. ------------
  315. .. _enum_Node_ProcessMode:
  316. .. rst-class:: classref-enumeration
  317. enum **ProcessMode**:
  318. .. _class_Node_constant_PROCESS_MODE_INHERIT:
  319. .. rst-class:: classref-enumeration-constant
  320. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_INHERIT** = ``0``
  321. Inherits process mode from the node's parent. For the root node, it is equivalent to :ref:`PROCESS_MODE_PAUSABLE<class_Node_constant_PROCESS_MODE_PAUSABLE>`. Default.
  322. .. _class_Node_constant_PROCESS_MODE_PAUSABLE:
  323. .. rst-class:: classref-enumeration-constant
  324. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_PAUSABLE** = ``1``
  325. Stops processing when the :ref:`SceneTree<class_SceneTree>` is paused (process when unpaused). This is the inverse of :ref:`PROCESS_MODE_WHEN_PAUSED<class_Node_constant_PROCESS_MODE_WHEN_PAUSED>`.
  326. .. _class_Node_constant_PROCESS_MODE_WHEN_PAUSED:
  327. .. rst-class:: classref-enumeration-constant
  328. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_WHEN_PAUSED** = ``2``
  329. Only process when the :ref:`SceneTree<class_SceneTree>` is paused (don't process when unpaused). This is the inverse of :ref:`PROCESS_MODE_PAUSABLE<class_Node_constant_PROCESS_MODE_PAUSABLE>`.
  330. .. _class_Node_constant_PROCESS_MODE_ALWAYS:
  331. .. rst-class:: classref-enumeration-constant
  332. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_ALWAYS** = ``3``
  333. Always process. Continue processing always, ignoring the :ref:`SceneTree<class_SceneTree>`'s paused property. This is the inverse of :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  334. .. _class_Node_constant_PROCESS_MODE_DISABLED:
  335. .. rst-class:: classref-enumeration-constant
  336. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_DISABLED** = ``4``
  337. Never process. Completely disables processing, ignoring the :ref:`SceneTree<class_SceneTree>`'s paused property. This is the inverse of :ref:`PROCESS_MODE_ALWAYS<class_Node_constant_PROCESS_MODE_ALWAYS>`.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _enum_Node_ProcessThreadGroup:
  341. .. rst-class:: classref-enumeration
  342. enum **ProcessThreadGroup**:
  343. .. _class_Node_constant_PROCESS_THREAD_GROUP_INHERIT:
  344. .. rst-class:: classref-enumeration-constant
  345. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_INHERIT** = ``0``
  346. 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.
  347. .. _class_Node_constant_PROCESS_THREAD_GROUP_MAIN_THREAD:
  348. .. rst-class:: classref-enumeration-constant
  349. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_MAIN_THREAD** = ``1``
  350. 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.
  351. .. _class_Node_constant_PROCESS_THREAD_GROUP_SUB_THREAD:
  352. .. rst-class:: classref-enumeration-constant
  353. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_SUB_THREAD** = ``2``
  354. 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.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _enum_Node_ProcessThreadMessages:
  358. .. rst-class:: classref-enumeration
  359. flags **ProcessThreadMessages**:
  360. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES:
  361. .. rst-class:: classref-enumeration-constant
  362. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES** = ``1``
  363. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES_PHYSICS:
  364. .. rst-class:: classref-enumeration-constant
  365. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES_PHYSICS** = ``2``
  366. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES_ALL:
  367. .. rst-class:: classref-enumeration-constant
  368. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES_ALL** = ``3``
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _enum_Node_DuplicateFlags:
  372. .. rst-class:: classref-enumeration
  373. enum **DuplicateFlags**:
  374. .. _class_Node_constant_DUPLICATE_SIGNALS:
  375. .. rst-class:: classref-enumeration-constant
  376. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SIGNALS** = ``1``
  377. Duplicate the node's signals.
  378. .. _class_Node_constant_DUPLICATE_GROUPS:
  379. .. rst-class:: classref-enumeration-constant
  380. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_GROUPS** = ``2``
  381. Duplicate the node's groups.
  382. .. _class_Node_constant_DUPLICATE_SCRIPTS:
  383. .. rst-class:: classref-enumeration-constant
  384. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SCRIPTS** = ``4``
  385. Duplicate the node's scripts.
  386. .. _class_Node_constant_DUPLICATE_USE_INSTANTIATION:
  387. .. rst-class:: classref-enumeration-constant
  388. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_USE_INSTANTIATION** = ``8``
  389. Duplicate using instancing.
  390. An instance stays linked to the original so when the original changes, the instance changes too.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _enum_Node_InternalMode:
  394. .. rst-class:: classref-enumeration
  395. enum **InternalMode**:
  396. .. _class_Node_constant_INTERNAL_MODE_DISABLED:
  397. .. rst-class:: classref-enumeration-constant
  398. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_DISABLED** = ``0``
  399. Node will not be internal.
  400. .. _class_Node_constant_INTERNAL_MODE_FRONT:
  401. .. rst-class:: classref-enumeration-constant
  402. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_FRONT** = ``1``
  403. The node will be placed at the beginning of the parent's children, before any non-internal sibling.
  404. .. _class_Node_constant_INTERNAL_MODE_BACK:
  405. .. rst-class:: classref-enumeration-constant
  406. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_BACK** = ``2``
  407. The node will be placed at the end of the parent's children, after any non-internal sibling.
  408. .. rst-class:: classref-section-separator
  409. ----
  410. .. rst-class:: classref-descriptions-group
  411. Constants
  412. ---------
  413. .. _class_Node_constant_NOTIFICATION_ENTER_TREE:
  414. .. rst-class:: classref-constant
  415. **NOTIFICATION_ENTER_TREE** = ``10``
  416. Notification received when the node enters a :ref:`SceneTree<class_SceneTree>`.
  417. This notification is emitted *before* the related :ref:`tree_entered<class_Node_signal_tree_entered>`.
  418. .. _class_Node_constant_NOTIFICATION_EXIT_TREE:
  419. .. rst-class:: classref-constant
  420. **NOTIFICATION_EXIT_TREE** = ``11``
  421. Notification received when the node is about to exit a :ref:`SceneTree<class_SceneTree>`.
  422. This notification is emitted *after* the related :ref:`tree_exiting<class_Node_signal_tree_exiting>`.
  423. .. _class_Node_constant_NOTIFICATION_MOVED_IN_PARENT:
  424. .. rst-class:: classref-constant
  425. **NOTIFICATION_MOVED_IN_PARENT** = ``12``
  426. *Deprecated.* This notification is no longer emitted. Use :ref:`NOTIFICATION_CHILD_ORDER_CHANGED<class_Node_constant_NOTIFICATION_CHILD_ORDER_CHANGED>` instead.
  427. .. _class_Node_constant_NOTIFICATION_READY:
  428. .. rst-class:: classref-constant
  429. **NOTIFICATION_READY** = ``13``
  430. Notification received when the node is ready. See :ref:`_ready<class_Node_method__ready>`.
  431. .. _class_Node_constant_NOTIFICATION_PAUSED:
  432. .. rst-class:: classref-constant
  433. **NOTIFICATION_PAUSED** = ``14``
  434. Notification received when the node is paused.
  435. .. _class_Node_constant_NOTIFICATION_UNPAUSED:
  436. .. rst-class:: classref-constant
  437. **NOTIFICATION_UNPAUSED** = ``15``
  438. Notification received when the node is unpaused.
  439. .. _class_Node_constant_NOTIFICATION_PHYSICS_PROCESS:
  440. .. rst-class:: classref-constant
  441. **NOTIFICATION_PHYSICS_PROCESS** = ``16``
  442. Notification received every frame when the physics process flag is set (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  443. .. _class_Node_constant_NOTIFICATION_PROCESS:
  444. .. rst-class:: classref-constant
  445. **NOTIFICATION_PROCESS** = ``17``
  446. Notification received every frame when the process flag is set (see :ref:`set_process<class_Node_method_set_process>`).
  447. .. _class_Node_constant_NOTIFICATION_PARENTED:
  448. .. rst-class:: classref-constant
  449. **NOTIFICATION_PARENTED** = ``18``
  450. Notification received when a node is set as a child of another node.
  451. \ **Note:** This doesn't mean that a node entered the :ref:`SceneTree<class_SceneTree>`.
  452. .. _class_Node_constant_NOTIFICATION_UNPARENTED:
  453. .. rst-class:: classref-constant
  454. **NOTIFICATION_UNPARENTED** = ``19``
  455. Notification received when a node is unparented (parent removed it from the list of children).
  456. .. _class_Node_constant_NOTIFICATION_SCENE_INSTANTIATED:
  457. .. rst-class:: classref-constant
  458. **NOTIFICATION_SCENE_INSTANTIATED** = ``20``
  459. Notification received by scene owner when its scene is instantiated.
  460. .. _class_Node_constant_NOTIFICATION_DRAG_BEGIN:
  461. .. rst-class:: classref-constant
  462. **NOTIFICATION_DRAG_BEGIN** = ``21``
  463. Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one.
  464. Can be triggered either by dragging a :ref:`Control<class_Control>` that provides drag data (see :ref:`Control._get_drag_data<class_Control_method__get_drag_data>`) or using :ref:`Control.force_drag<class_Control_method_force_drag>`.
  465. Use :ref:`Viewport.gui_get_drag_data<class_Viewport_method_gui_get_drag_data>` to get the dragged data.
  466. .. _class_Node_constant_NOTIFICATION_DRAG_END:
  467. .. rst-class:: classref-constant
  468. **NOTIFICATION_DRAG_END** = ``22``
  469. Notification received when a drag operation ends.
  470. Use :ref:`Viewport.gui_is_drag_successful<class_Viewport_method_gui_is_drag_successful>` to check if the drag succeeded.
  471. .. _class_Node_constant_NOTIFICATION_PATH_RENAMED:
  472. .. rst-class:: classref-constant
  473. **NOTIFICATION_PATH_RENAMED** = ``23``
  474. Notification received when the node's name or one of its parents' name is changed. This notification is *not* received when the node is removed from the scene tree to be added to another parent later on.
  475. .. _class_Node_constant_NOTIFICATION_CHILD_ORDER_CHANGED:
  476. .. rst-class:: classref-constant
  477. **NOTIFICATION_CHILD_ORDER_CHANGED** = ``24``
  478. Notification received when the list of children is changed. This happens when child nodes are added, moved or removed.
  479. .. _class_Node_constant_NOTIFICATION_INTERNAL_PROCESS:
  480. .. rst-class:: classref-constant
  481. **NOTIFICATION_INTERNAL_PROCESS** = ``25``
  482. Notification received every frame when the internal process flag is set (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  483. .. _class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS:
  484. .. rst-class:: classref-constant
  485. **NOTIFICATION_INTERNAL_PHYSICS_PROCESS** = ``26``
  486. Notification received every frame when the internal physics process flag is set (see :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>`).
  487. .. _class_Node_constant_NOTIFICATION_POST_ENTER_TREE:
  488. .. rst-class:: classref-constant
  489. **NOTIFICATION_POST_ENTER_TREE** = ``27``
  490. Notification received when the node is ready, just before :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` is received. Unlike the latter, it's sent every time the node enters tree, instead of only once.
  491. .. _class_Node_constant_NOTIFICATION_DISABLED:
  492. .. rst-class:: classref-constant
  493. **NOTIFICATION_DISABLED** = ``28``
  494. Notification received when the node is disabled. See :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  495. .. _class_Node_constant_NOTIFICATION_ENABLED:
  496. .. rst-class:: classref-constant
  497. **NOTIFICATION_ENABLED** = ``29``
  498. Notification received when the node is enabled again after being disabled. See :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  499. .. _class_Node_constant_NOTIFICATION_NODE_RECACHE_REQUESTED:
  500. .. rst-class:: classref-constant
  501. **NOTIFICATION_NODE_RECACHE_REQUESTED** = ``30``
  502. Notification received when other nodes in the tree may have been removed/replaced and node pointers may require re-caching.
  503. .. _class_Node_constant_NOTIFICATION_EDITOR_PRE_SAVE:
  504. .. rst-class:: classref-constant
  505. **NOTIFICATION_EDITOR_PRE_SAVE** = ``9001``
  506. 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.
  507. .. _class_Node_constant_NOTIFICATION_EDITOR_POST_SAVE:
  508. .. rst-class:: classref-constant
  509. **NOTIFICATION_EDITOR_POST_SAVE** = ``9002``
  510. 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.
  511. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_ENTER:
  512. .. rst-class:: classref-constant
  513. **NOTIFICATION_WM_MOUSE_ENTER** = ``1002``
  514. Notification received from the OS when the mouse enters the game window.
  515. Implemented on desktop and web platforms.
  516. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_EXIT:
  517. .. rst-class:: classref-constant
  518. **NOTIFICATION_WM_MOUSE_EXIT** = ``1003``
  519. Notification received from the OS when the mouse leaves the game window.
  520. Implemented on desktop and web platforms.
  521. .. _class_Node_constant_NOTIFICATION_WM_WINDOW_FOCUS_IN:
  522. .. rst-class:: classref-constant
  523. **NOTIFICATION_WM_WINDOW_FOCUS_IN** = ``1004``
  524. Notification received when the node's parent :ref:`Window<class_Window>` 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 emitted).
  525. A :ref:`Window<class_Window>` node receives this notification when it is focused.
  526. .. _class_Node_constant_NOTIFICATION_WM_WINDOW_FOCUS_OUT:
  527. .. rst-class:: classref-constant
  528. **NOTIFICATION_WM_WINDOW_FOCUS_OUT** = ``1005``
  529. Notification received when the node's parent :ref:`Window<class_Window>` 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 emitted).
  530. A :ref:`Window<class_Window>` node receives this notification when it is defocused.
  531. .. _class_Node_constant_NOTIFICATION_WM_CLOSE_REQUEST:
  532. .. rst-class:: classref-constant
  533. **NOTIFICATION_WM_CLOSE_REQUEST** = ``1006``
  534. Notification received from the OS when a close request is sent (e.g. closing the window with a "Close" button or :kbd:`Alt + F4`).
  535. Implemented on desktop platforms.
  536. .. _class_Node_constant_NOTIFICATION_WM_GO_BACK_REQUEST:
  537. .. rst-class:: classref-constant
  538. **NOTIFICATION_WM_GO_BACK_REQUEST** = ``1007``
  539. Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
  540. Specific to the Android platform.
  541. .. _class_Node_constant_NOTIFICATION_WM_SIZE_CHANGED:
  542. .. rst-class:: classref-constant
  543. **NOTIFICATION_WM_SIZE_CHANGED** = ``1008``
  544. Notification received from the OS when the window is resized.
  545. .. _class_Node_constant_NOTIFICATION_WM_DPI_CHANGE:
  546. .. rst-class:: classref-constant
  547. **NOTIFICATION_WM_DPI_CHANGE** = ``1009``
  548. Notification received from the OS when the screen's DPI has been changed. Only implemented on macOS.
  549. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_ENTER:
  550. .. rst-class:: classref-constant
  551. **NOTIFICATION_VP_MOUSE_ENTER** = ``1010``
  552. Notification received when the mouse enters the viewport.
  553. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_EXIT:
  554. .. rst-class:: classref-constant
  555. **NOTIFICATION_VP_MOUSE_EXIT** = ``1011``
  556. Notification received when the mouse leaves the viewport.
  557. .. _class_Node_constant_NOTIFICATION_OS_MEMORY_WARNING:
  558. .. rst-class:: classref-constant
  559. **NOTIFICATION_OS_MEMORY_WARNING** = ``2009``
  560. Notification received from the OS when the application is exceeding its allocated memory.
  561. Specific to the iOS platform.
  562. .. _class_Node_constant_NOTIFICATION_TRANSLATION_CHANGED:
  563. .. rst-class:: classref-constant
  564. **NOTIFICATION_TRANSLATION_CHANGED** = ``2010``
  565. 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>`.
  566. .. _class_Node_constant_NOTIFICATION_WM_ABOUT:
  567. .. rst-class:: classref-constant
  568. **NOTIFICATION_WM_ABOUT** = ``2011``
  569. Notification received from the OS when a request for "About" information is sent.
  570. Specific to the macOS platform.
  571. .. _class_Node_constant_NOTIFICATION_CRASH:
  572. .. rst-class:: classref-constant
  573. **NOTIFICATION_CRASH** = ``2012``
  574. Notification received from Godot's crash handler when the engine is about to crash.
  575. Implemented on desktop platforms if the crash handler is enabled.
  576. .. _class_Node_constant_NOTIFICATION_OS_IME_UPDATE:
  577. .. rst-class:: classref-constant
  578. **NOTIFICATION_OS_IME_UPDATE** = ``2013``
  579. Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
  580. Specific to the macOS platform.
  581. .. _class_Node_constant_NOTIFICATION_APPLICATION_RESUMED:
  582. .. rst-class:: classref-constant
  583. **NOTIFICATION_APPLICATION_RESUMED** = ``2014``
  584. Notification received from the OS when the application is resumed.
  585. Specific to the Android platform.
  586. .. _class_Node_constant_NOTIFICATION_APPLICATION_PAUSED:
  587. .. rst-class:: classref-constant
  588. **NOTIFICATION_APPLICATION_PAUSED** = ``2015``
  589. Notification received from the OS when the application is paused.
  590. Specific to the Android platform.
  591. .. _class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_IN:
  592. .. rst-class:: classref-constant
  593. **NOTIFICATION_APPLICATION_FOCUS_IN** = ``2016``
  594. 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.
  595. Implemented on desktop platforms.
  596. .. _class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_OUT:
  597. .. rst-class:: classref-constant
  598. **NOTIFICATION_APPLICATION_FOCUS_OUT** = ``2017``
  599. 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.
  600. Implemented on desktop platforms.
  601. .. _class_Node_constant_NOTIFICATION_TEXT_SERVER_CHANGED:
  602. .. rst-class:: classref-constant
  603. **NOTIFICATION_TEXT_SERVER_CHANGED** = ``2018``
  604. Notification received when text server is changed.
  605. .. rst-class:: classref-section-separator
  606. ----
  607. .. rst-class:: classref-descriptions-group
  608. Property Descriptions
  609. ---------------------
  610. .. _class_Node_property_editor_description:
  611. .. rst-class:: classref-property
  612. :ref:`String<class_String>` **editor_description** = ``""``
  613. .. rst-class:: classref-property-setget
  614. - void **set_editor_description** **(** :ref:`String<class_String>` value **)**
  615. - :ref:`String<class_String>` **get_editor_description** **(** **)**
  616. Add a custom description to a node. It will be displayed in a tooltip when hovered in editor's scene tree.
  617. .. rst-class:: classref-item-separator
  618. ----
  619. .. _class_Node_property_multiplayer:
  620. .. rst-class:: classref-property
  621. :ref:`MultiplayerAPI<class_MultiplayerAPI>` **multiplayer**
  622. .. rst-class:: classref-property-setget
  623. - :ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_multiplayer** **(** **)**
  624. The :ref:`MultiplayerAPI<class_MultiplayerAPI>` instance associated with this node. See :ref:`SceneTree.get_multiplayer<class_SceneTree_method_get_multiplayer>`.
  625. .. rst-class:: classref-item-separator
  626. ----
  627. .. _class_Node_property_name:
  628. .. rst-class:: classref-property
  629. :ref:`StringName<class_StringName>` **name**
  630. .. rst-class:: classref-property-setget
  631. - void **set_name** **(** :ref:`StringName<class_StringName>` value **)**
  632. - :ref:`StringName<class_StringName>` **get_name** **(** **)**
  633. The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed.
  634. \ **Note:** Auto-generated names might include the ``@`` character, which is reserved for unique names when using :ref:`add_child<class_Node_method_add_child>`. When setting the name manually, any ``@`` will be removed.
  635. .. rst-class:: classref-item-separator
  636. ----
  637. .. _class_Node_property_owner:
  638. .. rst-class:: classref-property
  639. :ref:`Node<class_Node>` **owner**
  640. .. rst-class:: classref-property-setget
  641. - void **set_owner** **(** :ref:`Node<class_Node>` value **)**
  642. - :ref:`Node<class_Node>` **get_owner** **(** **)**
  643. The node owner. A node can have any ancestor node as owner (i.e. a parent, grandparent, etc. node ascending in the tree). This implies that :ref:`add_child<class_Node_method_add_child>` should be called before setting the owner, so that this relationship of parenting exists. When saving a node (using :ref:`PackedScene<class_PackedScene>`), all the nodes it owns will be saved with it. This allows for the creation of complex scene trees, with instancing and subinstancing.
  644. \ **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 a new node is added to the tree without setting its owner as an ancestor in that tree, it will be visible in the 2D/3D view, but not in the scene tree (and not persisted when packing or saving).
  645. .. rst-class:: classref-item-separator
  646. ----
  647. .. _class_Node_property_process_mode:
  648. .. rst-class:: classref-property
  649. :ref:`ProcessMode<enum_Node_ProcessMode>` **process_mode** = ``0``
  650. .. rst-class:: classref-property-setget
  651. - void **set_process_mode** **(** :ref:`ProcessMode<enum_Node_ProcessMode>` value **)**
  652. - :ref:`ProcessMode<enum_Node_ProcessMode>` **get_process_mode** **(** **)**
  653. Can be used to pause or unpause the node, or make the node paused based on the :ref:`SceneTree<class_SceneTree>`, or make it inherit the process mode from its parent (default).
  654. .. rst-class:: classref-item-separator
  655. ----
  656. .. _class_Node_property_process_physics_priority:
  657. .. rst-class:: classref-property
  658. :ref:`int<class_int>` **process_physics_priority** = ``0``
  659. .. rst-class:: classref-property-setget
  660. - void **set_physics_process_priority** **(** :ref:`int<class_int>` value **)**
  661. - :ref:`int<class_int>` **get_physics_process_priority** **(** **)**
  662. 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_method__physics_process>` or the internal version.
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_Node_property_process_priority:
  666. .. rst-class:: classref-property
  667. :ref:`int<class_int>` **process_priority** = ``0``
  668. .. rst-class:: classref-property-setget
  669. - void **set_process_priority** **(** :ref:`int<class_int>` value **)**
  670. - :ref:`int<class_int>` **get_process_priority** **(** **)**
  671. The node's priority in the execution order of the enabled processing callbacks (i.e. :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>`, :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` and their internal counterparts). Nodes whose process priority value is *lower* will have their processing callbacks executed first.
  672. .. rst-class:: classref-item-separator
  673. ----
  674. .. _class_Node_property_process_thread_group:
  675. .. rst-class:: classref-property
  676. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **process_thread_group** = ``0``
  677. .. rst-class:: classref-property-setget
  678. - void **set_process_thread_group** **(** :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` value **)**
  679. - :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **get_process_thread_group** **(** **)**
  680. 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_method__process>` or :ref:`_physics_process<class_Node_method__physics_process>` (and the internal versions) on the main thread or in a sub-thread.
  681. 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.
  682. 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).
  683. 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.
  684. .. rst-class:: classref-item-separator
  685. ----
  686. .. _class_Node_property_process_thread_group_order:
  687. .. rst-class:: classref-property
  688. :ref:`int<class_int>` **process_thread_group_order**
  689. .. rst-class:: classref-property-setget
  690. - void **set_process_thread_group_order** **(** :ref:`int<class_int>` value **)**
  691. - :ref:`int<class_int>` **get_process_thread_group_order** **(** **)**
  692. 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.
  693. .. rst-class:: classref-item-separator
  694. ----
  695. .. _class_Node_property_process_thread_messages:
  696. .. rst-class:: classref-property
  697. |bitfield|\<:ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>`\> **process_thread_messages**
  698. .. rst-class:: classref-property-setget
  699. - void **set_process_thread_messages** **(** |bitfield|\<:ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>`\> value **)**
  700. - |bitfield|\<:ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>`\> **get_process_thread_messages** **(** **)**
  701. 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.
  702. .. rst-class:: classref-item-separator
  703. ----
  704. .. _class_Node_property_scene_file_path:
  705. .. rst-class:: classref-property
  706. :ref:`String<class_String>` **scene_file_path**
  707. .. rst-class:: classref-property-setget
  708. - void **set_scene_file_path** **(** :ref:`String<class_String>` value **)**
  709. - :ref:`String<class_String>` **get_scene_file_path** **(** **)**
  710. If a scene is instantiated from a file, its topmost node contains the absolute file path from which it was loaded in :ref:`scene_file_path<class_Node_property_scene_file_path>` (e.g. ``res://levels/1.tscn``). Otherwise, :ref:`scene_file_path<class_Node_property_scene_file_path>` is set to an empty string.
  711. .. rst-class:: classref-item-separator
  712. ----
  713. .. _class_Node_property_unique_name_in_owner:
  714. .. rst-class:: classref-property
  715. :ref:`bool<class_bool>` **unique_name_in_owner** = ``false``
  716. .. rst-class:: classref-property-setget
  717. - void **set_unique_name_in_owner** **(** :ref:`bool<class_bool>` value **)**
  718. - :ref:`bool<class_bool>` **is_unique_name_in_owner** **(** **)**
  719. Sets this node's name as a unique name in its :ref:`owner<class_Node_property_owner>`. This allows the node to be accessed as ``%Name`` instead of the full path, from any node within that scene.
  720. If another node with the same owner already had that name declared as unique, that other node's name will no longer be set as having a unique name.
  721. .. rst-class:: classref-section-separator
  722. ----
  723. .. rst-class:: classref-descriptions-group
  724. Method Descriptions
  725. -------------------
  726. .. _class_Node_method__enter_tree:
  727. .. rst-class:: classref-method
  728. void **_enter_tree** **(** **)** |virtual|
  729. Called when the node enters the :ref:`SceneTree<class_SceneTree>` (e.g. upon instancing, 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_method__enter_tree>` callback will be called first, and then that of the children.
  730. Corresponds to the :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _class_Node_method__exit_tree:
  734. .. rst-class:: classref-method
  735. void **_exit_tree** **(** **)** |virtual|
  736. 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_method__exit_tree>` callback will be called last, after all its children have left the tree.
  737. Corresponds to the :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>` notification in :ref:`Object._notification<class_Object_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>`.
  738. .. rst-class:: classref-item-separator
  739. ----
  740. .. _class_Node_method__get_configuration_warnings:
  741. .. rst-class:: classref-method
  742. :ref:`PackedStringArray<class_PackedStringArray>` **_get_configuration_warnings** **(** **)** |virtual| |const|
  743. 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.
  744. Returning an empty array produces no warnings.
  745. Call :ref:`update_configuration_warnings<class_Node_method_update_configuration_warnings>` when the warnings need to be updated for this node.
  746. ::
  747. @export var energy = 0:
  748. set(value):
  749. energy = value
  750. update_configuration_warnings()
  751. func _get_configuration_warnings():
  752. if energy < 0:
  753. return ["Energy must be 0 or greater."]
  754. else:
  755. return []
  756. .. rst-class:: classref-item-separator
  757. ----
  758. .. _class_Node_method__input:
  759. .. rst-class:: classref-method
  760. void **_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  761. Called when there is an input event. The input event propagates up through the node tree until a node consumes it.
  762. 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>`.
  763. 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.
  764. For gameplay input, :ref:`_unhandled_input<class_Node_method__unhandled_input>` and :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` are usually a better fit as they allow the GUI to intercept the events first.
  765. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  766. .. rst-class:: classref-item-separator
  767. ----
  768. .. _class_Node_method__physics_process:
  769. .. rst-class:: classref-method
  770. void **_physics_process** **(** :ref:`float<class_float>` delta **)** |virtual|
  771. 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.
  772. 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>`.
  773. Corresponds to the :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  774. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  775. .. rst-class:: classref-item-separator
  776. ----
  777. .. _class_Node_method__process:
  778. .. rst-class:: classref-method
  779. void **_process** **(** :ref:`float<class_float>` delta **)** |virtual|
  780. 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.
  781. 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>`.
  782. Corresponds to the :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  783. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  784. .. rst-class:: classref-item-separator
  785. ----
  786. .. _class_Node_method__ready:
  787. .. rst-class:: classref-method
  788. void **_ready** **(** **)** |virtual|
  789. 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_method__ready>` callbacks get triggered first, and the parent node will receive the ready notification afterwards.
  790. Corresponds to the :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` notification in :ref:`Object._notification<class_Object_method__notification>`. See also the ``@onready`` annotation for variables.
  791. Usually used for initialization. For even earlier initialization, :ref:`Object._init<class_Object_method__init>` may be used. See also :ref:`_enter_tree<class_Node_method__enter_tree>`.
  792. \ **Note:** :ref:`_ready<class_Node_method__ready>` may be called only once for each node. After removing a node from the scene tree and adding it again, ``_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.
  793. .. rst-class:: classref-item-separator
  794. ----
  795. .. _class_Node_method__shortcut_input:
  796. .. rst-class:: classref-method
  797. void **_shortcut_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  798. Called when an :ref:`InputEventKey<class_InputEventKey>`\ ¸ :ref:`InputEventShortcut<class_InputEventShortcut>`, or :ref:`InputEventJoypadButton<class_InputEventJoypadButton>` hasn't been consumed by :ref:`_input<class_Node_method__input>` or any GUI :ref:`Control<class_Control>` item. The input event propagates up through the node tree until a node consumes it.
  799. 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>`.
  800. 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.
  801. This method can be used to handle shortcuts.
  802. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
  803. .. rst-class:: classref-item-separator
  804. ----
  805. .. _class_Node_method__unhandled_input:
  806. .. rst-class:: classref-method
  807. void **_unhandled_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  808. Called when an :ref:`InputEvent<class_InputEvent>` hasn't been consumed by :ref:`_input<class_Node_method__input>` or any GUI :ref:`Control<class_Control>` item. The input event propagates up through the node tree until a node consumes it.
  809. 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>`.
  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, this and :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` are usually a better fit than :ref:`_input<class_Node_method__input>` 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_method__unhandled_key_input:
  816. .. rst-class:: classref-method
  817. void **_unhandled_key_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  818. Called when an :ref:`InputEventKey<class_InputEventKey>` hasn't been consumed by :ref:`_input<class_Node_method__input>` or any GUI :ref:`Control<class_Control>` item. The input event propagates up through the node tree until a node consumes it.
  819. 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>`.
  820. 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.
  821. 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.
  822. For gameplay input, this and :ref:`_unhandled_input<class_Node_method__unhandled_input>` are usually a better fit than :ref:`_input<class_Node_method__input>` as they allow the GUI to intercept the events first.
  823. This method also performs better than :ref:`_unhandled_input<class_Node_method__unhandled_input>`, since unrelated events such as :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` are automatically filtered.
  824. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  825. .. rst-class:: classref-item-separator
  826. ----
  827. .. _class_Node_method_add_child:
  828. .. rst-class:: classref-method
  829. void **add_child** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` force_readable_name=false, :ref:`InternalMode<enum_Node_InternalMode>` internal=0 **)**
  830. 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.
  831. 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.
  832. If ``internal`` is different than :ref:`INTERNAL_MODE_DISABLED<class_Node_constant_INTERNAL_MODE_DISABLED>`, the child will be added as internal node. Such 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.
  833. \ **Note:** If the child node already has a parent, the function will fail. Use :ref:`remove_child<class_Node_method_remove_child>` first to remove the node from its current parent. For example:
  834. .. tabs::
  835. .. code-tab:: gdscript
  836. var child_node = get_child(0)
  837. if child_node.get_parent():
  838. child_node.get_parent().remove_child(child_node)
  839. add_child(child_node)
  840. .. code-tab:: csharp
  841. Node childNode = GetChild(0);
  842. if (childNode.GetParent() != null)
  843. {
  844. childNode.GetParent().RemoveChild(childNode);
  845. }
  846. AddChild(childNode);
  847. 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.
  848. \ **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.
  849. .. rst-class:: classref-item-separator
  850. ----
  851. .. _class_Node_method_add_sibling:
  852. .. rst-class:: classref-method
  853. void **add_sibling** **(** :ref:`Node<class_Node>` sibling, :ref:`bool<class_bool>` force_readable_name=false **)**
  854. Adds a ``sibling`` node to current's node parent, at the same level as that node, right below it.
  855. 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.
  856. 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.
  857. \ **Note:** If this node is internal, the new sibling will be internal too (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  858. .. rst-class:: classref-item-separator
  859. ----
  860. .. _class_Node_method_add_to_group:
  861. .. rst-class:: classref-method
  862. void **add_to_group** **(** :ref:`StringName<class_StringName>` group, :ref:`bool<class_bool>` persistent=false **)**
  863. Adds the node to a group. Groups are helpers to name and organize a subset of nodes, for example "enemies" or "collectables". A node can be in any number of groups. Nodes can be assigned a group at any time, but will not be added until they are inside the scene tree (see :ref:`is_inside_tree<class_Node_method_is_inside_tree>`). See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  864. The ``persistent`` option is used when packing node to :ref:`PackedScene<class_PackedScene>` and saving to file. Non-persistent groups aren't stored.
  865. \ **Note:** For performance reasons, the order of node groups is *not* guaranteed. The order of node groups should not be relied upon as it can vary across project runs.
  866. .. rst-class:: classref-item-separator
  867. ----
  868. .. _class_Node_method_call_deferred_thread_group:
  869. .. rst-class:: classref-method
  870. :ref:`Variant<class_Variant>` **call_deferred_thread_group** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  871. 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_method__process>` or :ref:`_physics_process<class_Node_method__physics_process>` or their internal versions are called.
  872. .. rst-class:: classref-item-separator
  873. ----
  874. .. _class_Node_method_call_thread_safe:
  875. .. rst-class:: classref-method
  876. :ref:`Variant<class_Variant>` **call_thread_safe** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  877. 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.
  878. .. rst-class:: classref-item-separator
  879. ----
  880. .. _class_Node_method_can_process:
  881. .. rst-class:: classref-method
  882. :ref:`bool<class_bool>` **can_process** **(** **)** |const|
  883. Returns ``true`` if the node can process while the scene tree is paused (see :ref:`process_mode<class_Node_property_process_mode>`). Always returns ``true`` if the scene tree is not paused, and ``false`` if the node is not in the tree.
  884. .. rst-class:: classref-item-separator
  885. ----
  886. .. _class_Node_method_create_tween:
  887. .. rst-class:: classref-method
  888. :ref:`Tween<class_Tween>` **create_tween** **(** **)**
  889. Creates a new :ref:`Tween<class_Tween>` and binds it to this node. This is equivalent of doing:
  890. .. tabs::
  891. .. code-tab:: gdscript
  892. get_tree().create_tween().bind_node(self)
  893. .. code-tab:: csharp
  894. GetTree().CreateTween().BindNode(this);
  895. The Tween will start automatically on the next process frame or physics frame (depending on :ref:`TweenProcessMode<enum_Tween_TweenProcessMode>`).
  896. .. rst-class:: classref-item-separator
  897. ----
  898. .. _class_Node_method_duplicate:
  899. .. rst-class:: classref-method
  900. :ref:`Node<class_Node>` **duplicate** **(** :ref:`int<class_int>` flags=15 **)** |const|
  901. Duplicates the node, returning a new node.
  902. You can fine-tune the behavior using the ``flags`` (see :ref:`DuplicateFlags<enum_Node_DuplicateFlags>`).
  903. \ **Note:** It will not work properly if the node contains a script with constructor arguments (i.e. needs to supply arguments to :ref:`Object._init<class_Object_method__init>` method). In that case, the node will be duplicated without a script.
  904. .. rst-class:: classref-item-separator
  905. ----
  906. .. _class_Node_method_find_child:
  907. .. rst-class:: classref-method
  908. :ref:`Node<class_Node>` **find_child** **(** :ref:`String<class_String>` pattern, :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const|
  909. Finds the first descendant of this node whose name matches ``pattern`` as in :ref:`String.match<class_String_method_match>`. Internal children are also searched over (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  910. \ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``).
  911. If ``recursive`` is ``true``, all child nodes are included, even if deeply nested. 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. If ``recursive`` is ``false``, only this node's direct children are matched.
  912. If ``owned`` is ``true``, this method only finds nodes who have an assigned :ref:`owner<class_Node_property_owner>`. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
  913. Returns ``null`` if no matching **Node** is found.
  914. \ **Note:** As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using :ref:`get_node<class_Node_method_get_node>` with unique names instead (see :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>`), or caching the node references into variable.
  915. \ **Note:** To find all descendant nodes matching a pattern or a class type, see :ref:`find_children<class_Node_method_find_children>`.
  916. .. rst-class:: classref-item-separator
  917. ----
  918. .. _class_Node_method_find_children:
  919. .. rst-class:: classref-method
  920. :ref:`Node[]<class_Node>` **find_children** **(** :ref:`String<class_String>` pattern, :ref:`String<class_String>` type="", :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const|
  921. Finds descendants of this node whose name matches ``pattern`` as in :ref:`String.match<class_String_method_match>`, and/or type matches ``type`` as in :ref:`Object.is_class<class_Object_method_is_class>`. Internal children are also searched over (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  922. \ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``).
  923. \ ``type`` will check equality or inheritance, and is case-sensitive. ``"Object"`` will match a node whose type is ``"Node"`` but not the other way around.
  924. If ``recursive`` is ``true``, all child nodes are included, even if deeply nested. 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. If ``recursive`` is ``false``, only this node's direct children are matched.
  925. If ``owned`` is ``true``, this method only finds nodes who have an assigned :ref:`owner<class_Node_property_owner>`. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
  926. Returns an empty array if no matching nodes are found.
  927. \ **Note:** As this method walks through all the descendants of the node, it is the slowest way to get references to other nodes. Whenever possible, consider caching the node references into variables.
  928. \ **Note:** If you only want to find the first descendant node that matches a pattern, see :ref:`find_child<class_Node_method_find_child>`.
  929. .. rst-class:: classref-item-separator
  930. ----
  931. .. _class_Node_method_find_parent:
  932. .. rst-class:: classref-method
  933. :ref:`Node<class_Node>` **find_parent** **(** :ref:`String<class_String>` pattern **)** |const|
  934. Finds the first parent of the current node whose name matches ``pattern`` as in :ref:`String.match<class_String_method_match>`.
  935. \ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``).
  936. \ **Note:** As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using :ref:`get_node<class_Node_method_get_node>` with unique names instead (see :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>`), or caching the node references into variable.
  937. .. rst-class:: classref-item-separator
  938. ----
  939. .. _class_Node_method_get_child:
  940. .. rst-class:: classref-method
  941. :ref:`Node<class_Node>` **get_child** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` include_internal=false **)** |const|
  942. Returns a child node by its index (see :ref:`get_child_count<class_Node_method_get_child_count>`). This method is often used for iterating all children of a node.
  943. Negative indices access the children from the last one.
  944. If ``include_internal`` is ``false``, internal children are skipped (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  945. To access a child node via its name, use :ref:`get_node<class_Node_method_get_node>`.
  946. .. rst-class:: classref-item-separator
  947. ----
  948. .. _class_Node_method_get_child_count:
  949. .. rst-class:: classref-method
  950. :ref:`int<class_int>` **get_child_count** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  951. Returns the number of child nodes.
  952. If ``include_internal`` is ``false``, internal children aren't counted (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  953. .. rst-class:: classref-item-separator
  954. ----
  955. .. _class_Node_method_get_children:
  956. .. rst-class:: classref-method
  957. :ref:`Node[]<class_Node>` **get_children** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  958. Returns an array of references to node's children.
  959. If ``include_internal`` is ``false``, the returned array won't include internal children (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  960. .. rst-class:: classref-item-separator
  961. ----
  962. .. _class_Node_method_get_groups:
  963. .. rst-class:: classref-method
  964. :ref:`StringName[]<class_StringName>` **get_groups** **(** **)** |const|
  965. Returns an array listing the groups that the node is a member of.
  966. \ **Note:** For performance reasons, the order of node groups is *not* guaranteed. The order of node groups should not be relied upon as it can vary across project runs.
  967. \ **Note:** The engine uses some group names internally (all starting with an underscore). To avoid conflicts with internal groups, do not add custom groups whose name starts with an underscore. To exclude internal groups while looping over :ref:`get_groups<class_Node_method_get_groups>`, use the following snippet:
  968. .. tabs::
  969. .. code-tab:: gdscript
  970. # Stores the node's non-internal groups only (as an array of Strings).
  971. var non_internal_groups = []
  972. for group in get_groups():
  973. if not group.begins_with("_"):
  974. non_internal_groups.push_back(group)
  975. .. code-tab:: csharp
  976. // Stores the node's non-internal groups only (as a List of strings).
  977. List<string> nonInternalGroups = new List<string>();
  978. foreach (string group in GetGroups())
  979. {
  980. if (!group.BeginsWith("_"))
  981. nonInternalGroups.Add(group);
  982. }
  983. .. rst-class:: classref-item-separator
  984. ----
  985. .. _class_Node_method_get_index:
  986. .. rst-class:: classref-method
  987. :ref:`int<class_int>` **get_index** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  988. Returns the node's order in the scene tree branch. For example, if called on the first child node the position is ``0``.
  989. If ``include_internal`` is ``false``, the index won't take internal children into account, i.e. first non-internal child will have index of 0 (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_Node_method_get_last_exclusive_window:
  993. .. rst-class:: classref-method
  994. :ref:`Window<class_Window>` **get_last_exclusive_window** **(** **)** |const|
  995. 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.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_Node_method_get_multiplayer_authority:
  999. .. rst-class:: classref-method
  1000. :ref:`int<class_int>` **get_multiplayer_authority** **(** **)** |const|
  1001. Returns the peer ID of the multiplayer authority for this node. See :ref:`set_multiplayer_authority<class_Node_method_set_multiplayer_authority>`.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_Node_method_get_node:
  1005. .. rst-class:: classref-method
  1006. :ref:`Node<class_Node>` **get_node** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  1007. Fetches a node. The :ref:`NodePath<class_NodePath>` can be either a relative path (from the current node) or an absolute path (in the scene tree) to a node. If the path does not exist, ``null`` is returned and an error is logged. Attempts to access methods on the return value will result in an "Attempt to call <method> on a null instance." error.
  1008. \ **Note:** Fetching absolute paths only works when the node is inside the scene tree (see :ref:`is_inside_tree<class_Node_method_is_inside_tree>`).
  1009. \ **Example:** Assume your current node is Character and the following tree:
  1010. ::
  1011. /root
  1012. /root/Character
  1013. /root/Character/Sword
  1014. /root/Character/Backpack/Dagger
  1015. /root/MyGame
  1016. /root/Swamp/Alligator
  1017. /root/Swamp/Mosquito
  1018. /root/Swamp/Goblin
  1019. Possible paths are:
  1020. .. tabs::
  1021. .. code-tab:: gdscript
  1022. get_node("Sword")
  1023. get_node("Backpack/Dagger")
  1024. get_node("../Swamp/Alligator")
  1025. get_node("/root/MyGame")
  1026. .. code-tab:: csharp
  1027. GetNode("Sword");
  1028. GetNode("Backpack/Dagger");
  1029. GetNode("../Swamp/Alligator");
  1030. GetNode("/root/MyGame");
  1031. .. rst-class:: classref-item-separator
  1032. ----
  1033. .. _class_Node_method_get_node_and_resource:
  1034. .. rst-class:: classref-method
  1035. :ref:`Array<class_Array>` **get_node_and_resource** **(** :ref:`NodePath<class_NodePath>` path **)**
  1036. Fetches a node and one of its resources as specified by the :ref:`NodePath<class_NodePath>`'s subname (e.g. ``Area2D/CollisionShape2D:shape``). If several nested resources are specified in the :ref:`NodePath<class_NodePath>`, the last one will be fetched.
  1037. The return value is an array of size 3: the first index points to the **Node** (or ``null`` if not found), the second index points to the :ref:`Resource<class_Resource>` (or ``null`` if not found), and the third index is the remaining :ref:`NodePath<class_NodePath>`, if any.
  1038. For example, assuming that ``Area2D/CollisionShape2D`` is a valid node and that its ``shape`` property has been assigned a :ref:`RectangleShape2D<class_RectangleShape2D>` resource, one could have this kind of output:
  1039. .. tabs::
  1040. .. code-tab:: gdscript
  1041. print(get_node_and_resource("Area2D/CollisionShape2D")) # [[CollisionShape2D:1161], Null, ]
  1042. print(get_node_and_resource("Area2D/CollisionShape2D:shape")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
  1043. print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
  1044. .. code-tab:: csharp
  1045. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D")); // [[CollisionShape2D:1161], Null, ]
  1046. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
  1047. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape:extents")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
  1048. .. rst-class:: classref-item-separator
  1049. ----
  1050. .. _class_Node_method_get_node_or_null:
  1051. .. rst-class:: classref-method
  1052. :ref:`Node<class_Node>` **get_node_or_null** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  1053. Similar to :ref:`get_node<class_Node_method_get_node>`, but does not log an error if ``path`` does not point to a valid **Node**.
  1054. .. rst-class:: classref-item-separator
  1055. ----
  1056. .. _class_Node_method_get_parent:
  1057. .. rst-class:: classref-method
  1058. :ref:`Node<class_Node>` **get_parent** **(** **)** |const|
  1059. Returns the parent node of the current node, or ``null`` if the node lacks a parent.
  1060. .. rst-class:: classref-item-separator
  1061. ----
  1062. .. _class_Node_method_get_path:
  1063. .. rst-class:: classref-method
  1064. :ref:`NodePath<class_NodePath>` **get_path** **(** **)** |const|
  1065. Returns the absolute path of the current node. This only works if the current node is inside the scene tree (see :ref:`is_inside_tree<class_Node_method_is_inside_tree>`).
  1066. .. rst-class:: classref-item-separator
  1067. ----
  1068. .. _class_Node_method_get_path_to:
  1069. .. rst-class:: classref-method
  1070. :ref:`NodePath<class_NodePath>` **get_path_to** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` use_unique_path=false **)** |const|
  1071. Returns the relative :ref:`NodePath<class_NodePath>` from this node to the specified ``node``. Both nodes must be in the same scene or the function will fail.
  1072. If ``use_unique_path`` is ``true``, returns the shortest path considering unique node.
  1073. \ **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.
  1074. .. rst-class:: classref-item-separator
  1075. ----
  1076. .. _class_Node_method_get_physics_process_delta_time:
  1077. .. rst-class:: classref-method
  1078. :ref:`float<class_float>` **get_physics_process_delta_time** **(** **)** |const|
  1079. Returns the time elapsed (in seconds) since the last physics-bound frame (see :ref:`_physics_process<class_Node_method__physics_process>`). This is always a constant value in physics processing unless the frames per second is changed via :ref:`Engine.physics_ticks_per_second<class_Engine_property_physics_ticks_per_second>`.
  1080. .. rst-class:: classref-item-separator
  1081. ----
  1082. .. _class_Node_method_get_process_delta_time:
  1083. .. rst-class:: classref-method
  1084. :ref:`float<class_float>` **get_process_delta_time** **(** **)** |const|
  1085. Returns the time elapsed (in seconds) since the last process callback. This value may vary from frame to frame.
  1086. .. rst-class:: classref-item-separator
  1087. ----
  1088. .. _class_Node_method_get_scene_instance_load_placeholder:
  1089. .. rst-class:: classref-method
  1090. :ref:`bool<class_bool>` **get_scene_instance_load_placeholder** **(** **)** |const|
  1091. Returns ``true`` if this is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
  1092. .. rst-class:: classref-item-separator
  1093. ----
  1094. .. _class_Node_method_get_tree:
  1095. .. rst-class:: classref-method
  1096. :ref:`SceneTree<class_SceneTree>` **get_tree** **(** **)** |const|
  1097. Returns the :ref:`SceneTree<class_SceneTree>` that contains this node. Returns ``null`` and prints an error if this node is not inside the scene tree. See also :ref:`is_inside_tree<class_Node_method_is_inside_tree>`.
  1098. .. rst-class:: classref-item-separator
  1099. ----
  1100. .. _class_Node_method_get_viewport:
  1101. .. rst-class:: classref-method
  1102. :ref:`Viewport<class_Viewport>` **get_viewport** **(** **)** |const|
  1103. Returns the node's :ref:`Viewport<class_Viewport>`.
  1104. .. rst-class:: classref-item-separator
  1105. ----
  1106. .. _class_Node_method_get_window:
  1107. .. rst-class:: classref-method
  1108. :ref:`Window<class_Window>` **get_window** **(** **)** |const|
  1109. 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()``).
  1110. .. rst-class:: classref-item-separator
  1111. ----
  1112. .. _class_Node_method_has_node:
  1113. .. rst-class:: classref-method
  1114. :ref:`bool<class_bool>` **has_node** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  1115. Returns ``true`` if the node that the :ref:`NodePath<class_NodePath>` points to exists.
  1116. .. rst-class:: classref-item-separator
  1117. ----
  1118. .. _class_Node_method_has_node_and_resource:
  1119. .. rst-class:: classref-method
  1120. :ref:`bool<class_bool>` **has_node_and_resource** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  1121. Returns ``true`` if the :ref:`NodePath<class_NodePath>` points to a valid node and its subname points to a valid resource, e.g. ``Area2D/CollisionShape2D:shape``. Properties with a non-:ref:`Resource<class_Resource>` type (e.g. nodes or primitive math types) are not considered resources.
  1122. .. rst-class:: classref-item-separator
  1123. ----
  1124. .. _class_Node_method_is_ancestor_of:
  1125. .. rst-class:: classref-method
  1126. :ref:`bool<class_bool>` **is_ancestor_of** **(** :ref:`Node<class_Node>` node **)** |const|
  1127. Returns ``true`` if the given node is a direct or indirect child of the current node.
  1128. .. rst-class:: classref-item-separator
  1129. ----
  1130. .. _class_Node_method_is_displayed_folded:
  1131. .. rst-class:: classref-method
  1132. :ref:`bool<class_bool>` **is_displayed_folded** **(** **)** |const|
  1133. Returns ``true`` if the node is folded (collapsed) in the Scene dock. This method is only intended for use with editor tooling.
  1134. .. rst-class:: classref-item-separator
  1135. ----
  1136. .. _class_Node_method_is_editable_instance:
  1137. .. rst-class:: classref-method
  1138. :ref:`bool<class_bool>` **is_editable_instance** **(** :ref:`Node<class_Node>` node **)** |const|
  1139. Returns ``true`` if ``node`` has editable children enabled relative to this node. This method is only intended for use with editor tooling.
  1140. .. rst-class:: classref-item-separator
  1141. ----
  1142. .. _class_Node_method_is_greater_than:
  1143. .. rst-class:: classref-method
  1144. :ref:`bool<class_bool>` **is_greater_than** **(** :ref:`Node<class_Node>` node **)** |const|
  1145. Returns ``true`` if the given node occurs later in the scene hierarchy than the current node.
  1146. .. rst-class:: classref-item-separator
  1147. ----
  1148. .. _class_Node_method_is_in_group:
  1149. .. rst-class:: classref-method
  1150. :ref:`bool<class_bool>` **is_in_group** **(** :ref:`StringName<class_StringName>` group **)** |const|
  1151. Returns ``true`` if this node is in the specified group. See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  1152. .. rst-class:: classref-item-separator
  1153. ----
  1154. .. _class_Node_method_is_inside_tree:
  1155. .. rst-class:: classref-method
  1156. :ref:`bool<class_bool>` **is_inside_tree** **(** **)** |const|
  1157. Returns ``true`` if this node is currently inside a :ref:`SceneTree<class_SceneTree>`.
  1158. .. rst-class:: classref-item-separator
  1159. ----
  1160. .. _class_Node_method_is_multiplayer_authority:
  1161. .. rst-class:: classref-method
  1162. :ref:`bool<class_bool>` **is_multiplayer_authority** **(** **)** |const|
  1163. Returns ``true`` if the local system is the multiplayer authority of this node.
  1164. .. rst-class:: classref-item-separator
  1165. ----
  1166. .. _class_Node_method_is_node_ready:
  1167. .. rst-class:: classref-method
  1168. :ref:`bool<class_bool>` **is_node_ready** **(** **)** |const|
  1169. Returns ``true`` if the node is ready, i.e. it's inside scene tree and all its children are initialized.
  1170. \ :ref:`request_ready<class_Node_method_request_ready>` resets it back to ``false``.
  1171. .. rst-class:: classref-item-separator
  1172. ----
  1173. .. _class_Node_method_is_physics_processing:
  1174. .. rst-class:: classref-method
  1175. :ref:`bool<class_bool>` **is_physics_processing** **(** **)** |const|
  1176. Returns ``true`` if physics processing is enabled (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  1177. .. rst-class:: classref-item-separator
  1178. ----
  1179. .. _class_Node_method_is_physics_processing_internal:
  1180. .. rst-class:: classref-method
  1181. :ref:`bool<class_bool>` **is_physics_processing_internal** **(** **)** |const|
  1182. Returns ``true`` if internal physics processing is enabled (see :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>`).
  1183. .. rst-class:: classref-item-separator
  1184. ----
  1185. .. _class_Node_method_is_processing:
  1186. .. rst-class:: classref-method
  1187. :ref:`bool<class_bool>` **is_processing** **(** **)** |const|
  1188. Returns ``true`` if processing is enabled (see :ref:`set_process<class_Node_method_set_process>`).
  1189. .. rst-class:: classref-item-separator
  1190. ----
  1191. .. _class_Node_method_is_processing_input:
  1192. .. rst-class:: classref-method
  1193. :ref:`bool<class_bool>` **is_processing_input** **(** **)** |const|
  1194. Returns ``true`` if the node is processing input (see :ref:`set_process_input<class_Node_method_set_process_input>`).
  1195. .. rst-class:: classref-item-separator
  1196. ----
  1197. .. _class_Node_method_is_processing_internal:
  1198. .. rst-class:: classref-method
  1199. :ref:`bool<class_bool>` **is_processing_internal** **(** **)** |const|
  1200. Returns ``true`` if internal processing is enabled (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  1201. .. rst-class:: classref-item-separator
  1202. ----
  1203. .. _class_Node_method_is_processing_shortcut_input:
  1204. .. rst-class:: classref-method
  1205. :ref:`bool<class_bool>` **is_processing_shortcut_input** **(** **)** |const|
  1206. Returns ``true`` if the node is processing shortcuts (see :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>`).
  1207. .. rst-class:: classref-item-separator
  1208. ----
  1209. .. _class_Node_method_is_processing_unhandled_input:
  1210. .. rst-class:: classref-method
  1211. :ref:`bool<class_bool>` **is_processing_unhandled_input** **(** **)** |const|
  1212. Returns ``true`` if the node is processing unhandled input (see :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>`).
  1213. .. rst-class:: classref-item-separator
  1214. ----
  1215. .. _class_Node_method_is_processing_unhandled_key_input:
  1216. .. rst-class:: classref-method
  1217. :ref:`bool<class_bool>` **is_processing_unhandled_key_input** **(** **)** |const|
  1218. 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>`).
  1219. .. rst-class:: classref-item-separator
  1220. ----
  1221. .. _class_Node_method_move_child:
  1222. .. rst-class:: classref-method
  1223. void **move_child** **(** :ref:`Node<class_Node>` child_node, :ref:`int<class_int>` to_index **)**
  1224. Moves a child node to a different index (order) among the other children. Since calls, signals, etc. are performed by tree order, changing the order of children nodes may be useful. If ``to_index`` is negative, the index will be counted from the end.
  1225. \ **Note:** Internal children can only be moved within their expected "internal range" (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  1226. .. rst-class:: classref-item-separator
  1227. ----
  1228. .. _class_Node_method_notify_deferred_thread_group:
  1229. .. rst-class:: classref-method
  1230. void **notify_deferred_thread_group** **(** :ref:`int<class_int>` what **)**
  1231. Similar to :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>`, but for notifications.
  1232. .. rst-class:: classref-item-separator
  1233. ----
  1234. .. _class_Node_method_notify_thread_safe:
  1235. .. rst-class:: classref-method
  1236. void **notify_thread_safe** **(** :ref:`int<class_int>` what **)**
  1237. Similar to :ref:`call_thread_safe<class_Node_method_call_thread_safe>`, but for notifications.
  1238. .. rst-class:: classref-item-separator
  1239. ----
  1240. .. _class_Node_method_print_orphan_nodes:
  1241. .. rst-class:: classref-method
  1242. void **print_orphan_nodes** **(** **)** |static|
  1243. Prints all orphan nodes (nodes outside the :ref:`SceneTree<class_SceneTree>`). Used for debugging.
  1244. \ **Note:** :ref:`print_orphan_nodes<class_Node_method_print_orphan_nodes>` only works in debug builds. When called in a project exported in release mode, :ref:`print_orphan_nodes<class_Node_method_print_orphan_nodes>` will not print anything.
  1245. .. rst-class:: classref-item-separator
  1246. ----
  1247. .. _class_Node_method_print_tree:
  1248. .. rst-class:: classref-method
  1249. void **print_tree** **(** **)**
  1250. Prints the tree to stdout. 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.
  1251. \ **Example output:**\
  1252. ::
  1253. TheGame
  1254. TheGame/Menu
  1255. TheGame/Menu/Label
  1256. TheGame/Menu/Camera2D
  1257. TheGame/SplashScreen
  1258. TheGame/SplashScreen/Camera2D
  1259. .. rst-class:: classref-item-separator
  1260. ----
  1261. .. _class_Node_method_print_tree_pretty:
  1262. .. rst-class:: classref-method
  1263. void **print_tree_pretty** **(** **)**
  1264. Similar to :ref:`print_tree<class_Node_method_print_tree>`, this prints the tree to stdout. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees.
  1265. \ **Example output:**\
  1266. ::
  1267. ┖╴TheGame
  1268. ┠╴Menu
  1269. ┃ ┠╴Label
  1270. ┃ ┖╴Camera2D
  1271. ┖╴SplashScreen
  1272. ┖╴Camera2D
  1273. .. rst-class:: classref-item-separator
  1274. ----
  1275. .. _class_Node_method_propagate_call:
  1276. .. rst-class:: classref-method
  1277. void **propagate_call** **(** :ref:`StringName<class_StringName>` method, :ref:`Array<class_Array>` args=[], :ref:`bool<class_bool>` parent_first=false **)**
  1278. Calls the given method (if present) with the arguments given in ``args`` on this node and recursively on all its children. If the ``parent_first`` argument is ``true``, the method will be called on the current node first, then on all its children. If ``parent_first`` is ``false``, the children will be called first.
  1279. .. rst-class:: classref-item-separator
  1280. ----
  1281. .. _class_Node_method_propagate_notification:
  1282. .. rst-class:: classref-method
  1283. void **propagate_notification** **(** :ref:`int<class_int>` what **)**
  1284. Notifies the current node and all its children recursively by calling :ref:`Object.notification<class_Object_method_notification>` on all of them.
  1285. .. rst-class:: classref-item-separator
  1286. ----
  1287. .. _class_Node_method_queue_free:
  1288. .. rst-class:: classref-method
  1289. void **queue_free** **(** **)**
  1290. Queues a node for deletion at the end of the current frame. When deleted, all of its child nodes will be deleted as well, and all references to the node and its children will become invalid, see :ref:`Object.free<class_Object_method_free>`.
  1291. It is safe to call :ref:`queue_free<class_Node_method_queue_free>` multiple times per frame on a node, and to :ref:`Object.free<class_Object_method_free>` a node that is currently queued for deletion. Use :ref:`Object.is_queued_for_deletion<class_Object_method_is_queued_for_deletion>` to check whether a node will be deleted at the end of the frame.
  1292. The node will only be freed after all other deferred calls are finished, so using :ref:`queue_free<class_Node_method_queue_free>` is not always the same as calling :ref:`Object.free<class_Object_method_free>` through :ref:`Object.call_deferred<class_Object_method_call_deferred>`.
  1293. .. rst-class:: classref-item-separator
  1294. ----
  1295. .. _class_Node_method_remove_child:
  1296. .. rst-class:: classref-method
  1297. void **remove_child** **(** :ref:`Node<class_Node>` node **)**
  1298. Removes a child node. The node is NOT deleted and must be deleted manually.
  1299. \ **Note:** This function may set the :ref:`owner<class_Node_property_owner>` of the removed Node (or its descendants) to be ``null``, if that :ref:`owner<class_Node_property_owner>` is no longer a parent or ancestor.
  1300. .. rst-class:: classref-item-separator
  1301. ----
  1302. .. _class_Node_method_remove_from_group:
  1303. .. rst-class:: classref-method
  1304. void **remove_from_group** **(** :ref:`StringName<class_StringName>` group **)**
  1305. Removes a node from the ``group``. Does nothing if the node is not in the ``group``. See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  1306. .. rst-class:: classref-item-separator
  1307. ----
  1308. .. _class_Node_method_reparent:
  1309. .. rst-class:: classref-method
  1310. void **reparent** **(** :ref:`Node<class_Node>` new_parent, :ref:`bool<class_bool>` keep_global_transform=true **)**
  1311. Changes the parent of this **Node** to the ``new_parent``. The node needs to already have a parent.
  1312. 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).
  1313. .. rst-class:: classref-item-separator
  1314. ----
  1315. .. _class_Node_method_replace_by:
  1316. .. rst-class:: classref-method
  1317. void **replace_by** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` keep_groups=false **)**
  1318. Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost.
  1319. If ``keep_groups`` is ``true``, the ``node`` is added to the same groups that the replaced node is in.
  1320. \ **Note:** The given node will become the new parent of any child nodes that the replaced node had.
  1321. \ **Note:** The replaced node is not automatically freed, so you either need to keep it in a variable for later use or free it using :ref:`Object.free<class_Object_method_free>`.
  1322. .. rst-class:: classref-item-separator
  1323. ----
  1324. .. _class_Node_method_request_ready:
  1325. .. rst-class:: classref-method
  1326. void **request_ready** **(** **)**
  1327. Requests that ``_ready`` be called again. Note that the method won't be called immediately, but is scheduled for when the node is added to the scene tree again (see :ref:`_ready<class_Node_method__ready>`). ``_ready`` is called only for the node which requested it, which means that you need to request ready for each child if you want them to call ``_ready`` too (in which case, ``_ready`` will be called in the same order as it would normally).
  1328. .. rst-class:: classref-item-separator
  1329. ----
  1330. .. _class_Node_method_rpc:
  1331. .. rst-class:: classref-method
  1332. :ref:`Error<enum_@GlobalScope_Error>` **rpc** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  1333. Sends a remote procedure call request for the given ``method`` to peers on the network (and locally), optionally sending all additional arguments as 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 node 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>`. Methods are not exposed to RPCs by default. Returns ``null``.
  1334. \ **Note:** You can only safely use RPCs on clients after you received the ``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 ``server_disconnected`` or by checking ``get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED``.
  1335. .. rst-class:: classref-item-separator
  1336. ----
  1337. .. _class_Node_method_rpc_config:
  1338. .. rst-class:: classref-method
  1339. void **rpc_config** **(** :ref:`StringName<class_StringName>` method, :ref:`Variant<class_Variant>` config **)**
  1340. Changes the RPC mode for the given ``method`` with the given ``config`` which should be ``null`` (to disable) or a :ref:`Dictionary<class_Dictionary>` in the form:
  1341. ::
  1342. {
  1343. rpc_mode = MultiplayerAPI.RPCMode,
  1344. transfer_mode = MultiplayerPeer.TransferMode,
  1345. call_local = false,
  1346. channel = 0,
  1347. }
  1348. See :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>` and :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>`. An alternative is annotating methods and properties with the corresponding :ref:`@GDScript.@rpc<class_@GDScript_annotation_@rpc>` annotation (``@rpc("any_peer")``, ``@rpc("authority")``). By default, methods are not exposed to networking (and RPCs).
  1349. .. rst-class:: classref-item-separator
  1350. ----
  1351. .. _class_Node_method_rpc_id:
  1352. .. rst-class:: classref-method
  1353. :ref:`Error<enum_@GlobalScope_Error>` **rpc_id** **(** :ref:`int<class_int>` peer_id, :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  1354. 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>`). Returns ``null``.
  1355. .. rst-class:: classref-item-separator
  1356. ----
  1357. .. _class_Node_method_set_deferred_thread_group:
  1358. .. rst-class:: classref-method
  1359. void **set_deferred_thread_group** **(** :ref:`StringName<class_StringName>` property, :ref:`Variant<class_Variant>` value **)**
  1360. Similar to :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>`, but for setting properties.
  1361. .. rst-class:: classref-item-separator
  1362. ----
  1363. .. _class_Node_method_set_display_folded:
  1364. .. rst-class:: classref-method
  1365. void **set_display_folded** **(** :ref:`bool<class_bool>` fold **)**
  1366. Sets the folded state of the node in the Scene dock. This method is only intended for use with editor tooling.
  1367. .. rst-class:: classref-item-separator
  1368. ----
  1369. .. _class_Node_method_set_editable_instance:
  1370. .. rst-class:: classref-method
  1371. void **set_editable_instance** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` is_editable **)**
  1372. Sets the editable children state of ``node`` relative to this node. This method is only intended for use with editor tooling.
  1373. .. rst-class:: classref-item-separator
  1374. ----
  1375. .. _class_Node_method_set_multiplayer_authority:
  1376. .. rst-class:: classref-method
  1377. void **set_multiplayer_authority** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` recursive=true **)**
  1378. 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. Useful in conjunction with :ref:`rpc_config<class_Node_method_rpc_config>` and the :ref:`MultiplayerAPI<class_MultiplayerAPI>`. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If ``recursive``, the given peer is recursively set as the authority for all children of this node.
  1379. \ **Warning:** This does **not** automatically replicate the new authority to other peers. It is developer's responsibility to do so. You can propagate the information about the new authority using :ref:`MultiplayerSpawner.spawn_function<class_MultiplayerSpawner_property_spawn_function>`, an RPC, or using a :ref:`MultiplayerSynchronizer<class_MultiplayerSynchronizer>`.
  1380. .. rst-class:: classref-item-separator
  1381. ----
  1382. .. _class_Node_method_set_physics_process:
  1383. .. rst-class:: classref-method
  1384. void **set_physics_process** **(** :ref:`bool<class_bool>` enable **)**
  1385. Enables or disables physics (i.e. 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_method__physics_process>` callback will be called if exists). Enabled automatically if :ref:`_physics_process<class_Node_method__physics_process>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1386. .. rst-class:: classref-item-separator
  1387. ----
  1388. .. _class_Node_method_set_physics_process_internal:
  1389. .. rst-class:: classref-method
  1390. void **set_physics_process_internal** **(** :ref:`bool<class_bool>` enable **)**
  1391. Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal :ref:`_physics_process<class_Node_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>`). Only useful for advanced uses to manipulate built-in nodes' behavior.
  1392. \ **Warning:** Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported.
  1393. .. rst-class:: classref-item-separator
  1394. ----
  1395. .. _class_Node_method_set_process:
  1396. .. rst-class:: classref-method
  1397. void **set_process** **(** :ref:`bool<class_bool>` enable **)**
  1398. Enables or disables 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_method__process>` callback will be called if exists). Enabled automatically if :ref:`_process<class_Node_method__process>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1399. .. rst-class:: classref-item-separator
  1400. ----
  1401. .. _class_Node_method_set_process_input:
  1402. .. rst-class:: classref-method
  1403. void **set_process_input** **(** :ref:`bool<class_bool>` enable **)**
  1404. Enables or disables input processing. This is not required for GUI controls! Enabled automatically if :ref:`_input<class_Node_method__input>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1405. .. rst-class:: classref-item-separator
  1406. ----
  1407. .. _class_Node_method_set_process_internal:
  1408. .. rst-class:: classref-method
  1409. void **set_process_internal** **(** :ref:`bool<class_bool>` enable **)**
  1410. Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal :ref:`_process<class_Node_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>`). Only useful for advanced uses to manipulate built-in nodes' behavior.
  1411. \ **Warning:** Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported.
  1412. .. rst-class:: classref-item-separator
  1413. ----
  1414. .. _class_Node_method_set_process_shortcut_input:
  1415. .. rst-class:: classref-method
  1416. void **set_process_shortcut_input** **(** :ref:`bool<class_bool>` enable **)**
  1417. Enables shortcut processing. Enabled automatically if :ref:`_shortcut_input<class_Node_method__shortcut_input>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1418. .. rst-class:: classref-item-separator
  1419. ----
  1420. .. _class_Node_method_set_process_unhandled_input:
  1421. .. rst-class:: classref-method
  1422. void **set_process_unhandled_input** **(** :ref:`bool<class_bool>` enable **)**
  1423. Enables unhandled input processing. This is not required for GUI controls! It enables the node to receive all input that was not previously handled (usually by a :ref:`Control<class_Control>`). Enabled automatically if :ref:`_unhandled_input<class_Node_method__unhandled_input>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1424. .. rst-class:: classref-item-separator
  1425. ----
  1426. .. _class_Node_method_set_process_unhandled_key_input:
  1427. .. rst-class:: classref-method
  1428. void **set_process_unhandled_key_input** **(** :ref:`bool<class_bool>` enable **)**
  1429. Enables unhandled key input processing. Enabled automatically if :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1430. .. rst-class:: classref-item-separator
  1431. ----
  1432. .. _class_Node_method_set_scene_instance_load_placeholder:
  1433. .. rst-class:: classref-method
  1434. void **set_scene_instance_load_placeholder** **(** :ref:`bool<class_bool>` load_placeholder **)**
  1435. Sets whether this is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
  1436. .. rst-class:: classref-item-separator
  1437. ----
  1438. .. _class_Node_method_set_thread_safe:
  1439. .. rst-class:: classref-method
  1440. void **set_thread_safe** **(** :ref:`StringName<class_StringName>` property, :ref:`Variant<class_Variant>` value **)**
  1441. Similar to :ref:`call_thread_safe<class_Node_method_call_thread_safe>`, but for setting properties.
  1442. .. rst-class:: classref-item-separator
  1443. ----
  1444. .. _class_Node_method_update_configuration_warnings:
  1445. .. rst-class:: classref-method
  1446. void **update_configuration_warnings** **(** **)**
  1447. Updates the warning displayed for this node in the Scene Dock.
  1448. Use :ref:`_get_configuration_warnings<class_Node_method__get_configuration_warnings>` to setup the warning message to display.
  1449. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1450. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1451. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1452. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1453. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1454. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1455. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`