2
0

class_node.rst 148 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Node.xml.
  6. .. _class_Node:
  7. Node
  8. ====
  9. **Inherits:** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`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. | :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_tree_entered:
  286. .. rst-class:: classref-signal
  287. **tree_entered** **(** **)**
  288. Emitted when the node enters the tree.
  289. This signal is emitted *after* the related :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification.
  290. .. rst-class:: classref-item-separator
  291. ----
  292. .. _class_Node_signal_tree_exited:
  293. .. rst-class:: classref-signal
  294. **tree_exited** **(** **)**
  295. Emitted after the node exits the tree and is no longer active.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_Node_signal_tree_exiting:
  299. .. rst-class:: classref-signal
  300. **tree_exiting** **(** **)**
  301. 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).
  302. This signal is emitted *before* the related :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>` notification.
  303. .. rst-class:: classref-section-separator
  304. ----
  305. .. rst-class:: classref-descriptions-group
  306. Enumerations
  307. ------------
  308. .. _enum_Node_ProcessMode:
  309. .. rst-class:: classref-enumeration
  310. enum **ProcessMode**:
  311. .. _class_Node_constant_PROCESS_MODE_INHERIT:
  312. .. rst-class:: classref-enumeration-constant
  313. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_INHERIT** = ``0``
  314. 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.
  315. .. _class_Node_constant_PROCESS_MODE_PAUSABLE:
  316. .. rst-class:: classref-enumeration-constant
  317. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_PAUSABLE** = ``1``
  318. 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>`.
  319. .. _class_Node_constant_PROCESS_MODE_WHEN_PAUSED:
  320. .. rst-class:: classref-enumeration-constant
  321. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_WHEN_PAUSED** = ``2``
  322. 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>`.
  323. .. _class_Node_constant_PROCESS_MODE_ALWAYS:
  324. .. rst-class:: classref-enumeration-constant
  325. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_ALWAYS** = ``3``
  326. 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>`.
  327. .. _class_Node_constant_PROCESS_MODE_DISABLED:
  328. .. rst-class:: classref-enumeration-constant
  329. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_DISABLED** = ``4``
  330. 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>`.
  331. .. rst-class:: classref-item-separator
  332. ----
  333. .. _enum_Node_ProcessThreadGroup:
  334. .. rst-class:: classref-enumeration
  335. enum **ProcessThreadGroup**:
  336. .. _class_Node_constant_PROCESS_THREAD_GROUP_INHERIT:
  337. .. rst-class:: classref-enumeration-constant
  338. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_INHERIT** = ``0``
  339. If the :ref:`process_thread_group<class_Node_property_process_thread_group>` property is sent to this, the node will belong to any 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.
  340. .. _class_Node_constant_PROCESS_THREAD_GROUP_MAIN_THREAD:
  341. .. rst-class:: classref-enumeration-constant
  342. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_MAIN_THREAD** = ``1``
  343. Process this node (and children nodes set to inherit) on the main thread. See :ref:`process_thread_group<class_Node_property_process_thread_group>` for more information.
  344. .. _class_Node_constant_PROCESS_THREAD_GROUP_SUB_THREAD:
  345. .. rst-class:: classref-enumeration-constant
  346. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **PROCESS_THREAD_GROUP_SUB_THREAD** = ``2``
  347. Process this node (and children nodes set to inherit) on a sub-thread. See :ref:`process_thread_group<class_Node_property_process_thread_group>` for more information.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _enum_Node_ProcessThreadMessages:
  351. .. rst-class:: classref-enumeration
  352. enum **ProcessThreadMessages**:
  353. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES:
  354. .. rst-class:: classref-enumeration-constant
  355. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES** = ``1``
  356. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES_PHYSICS:
  357. .. rst-class:: classref-enumeration-constant
  358. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES_PHYSICS** = ``2``
  359. .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES_ALL:
  360. .. rst-class:: classref-enumeration-constant
  361. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **FLAG_PROCESS_THREAD_MESSAGES_ALL** = ``3``
  362. .. rst-class:: classref-item-separator
  363. ----
  364. .. _enum_Node_DuplicateFlags:
  365. .. rst-class:: classref-enumeration
  366. enum **DuplicateFlags**:
  367. .. _class_Node_constant_DUPLICATE_SIGNALS:
  368. .. rst-class:: classref-enumeration-constant
  369. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SIGNALS** = ``1``
  370. Duplicate the node's signals.
  371. .. _class_Node_constant_DUPLICATE_GROUPS:
  372. .. rst-class:: classref-enumeration-constant
  373. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_GROUPS** = ``2``
  374. Duplicate the node's groups.
  375. .. _class_Node_constant_DUPLICATE_SCRIPTS:
  376. .. rst-class:: classref-enumeration-constant
  377. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SCRIPTS** = ``4``
  378. Duplicate the node's scripts.
  379. .. _class_Node_constant_DUPLICATE_USE_INSTANTIATION:
  380. .. rst-class:: classref-enumeration-constant
  381. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_USE_INSTANTIATION** = ``8``
  382. Duplicate using instancing.
  383. An instance stays linked to the original so when the original changes, the instance changes too.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _enum_Node_InternalMode:
  387. .. rst-class:: classref-enumeration
  388. enum **InternalMode**:
  389. .. _class_Node_constant_INTERNAL_MODE_DISABLED:
  390. .. rst-class:: classref-enumeration-constant
  391. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_DISABLED** = ``0``
  392. Node will not be internal.
  393. .. _class_Node_constant_INTERNAL_MODE_FRONT:
  394. .. rst-class:: classref-enumeration-constant
  395. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_FRONT** = ``1``
  396. Node will be placed at the front of parent's node list, before any non-internal sibling.
  397. .. _class_Node_constant_INTERNAL_MODE_BACK:
  398. .. rst-class:: classref-enumeration-constant
  399. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_BACK** = ``2``
  400. Node will be placed at the back of parent's node list, after any non-internal sibling.
  401. .. rst-class:: classref-section-separator
  402. ----
  403. .. rst-class:: classref-descriptions-group
  404. Constants
  405. ---------
  406. .. _class_Node_constant_NOTIFICATION_ENTER_TREE:
  407. .. rst-class:: classref-constant
  408. **NOTIFICATION_ENTER_TREE** = ``10``
  409. Notification received when the node enters a :ref:`SceneTree<class_SceneTree>`.
  410. This notification is emitted *before* the related :ref:`tree_entered<class_Node_signal_tree_entered>`.
  411. .. _class_Node_constant_NOTIFICATION_EXIT_TREE:
  412. .. rst-class:: classref-constant
  413. **NOTIFICATION_EXIT_TREE** = ``11``
  414. Notification received when the node is about to exit a :ref:`SceneTree<class_SceneTree>`.
  415. This notification is emitted *after* the related :ref:`tree_exiting<class_Node_signal_tree_exiting>`.
  416. .. _class_Node_constant_NOTIFICATION_MOVED_IN_PARENT:
  417. .. rst-class:: classref-constant
  418. **NOTIFICATION_MOVED_IN_PARENT** = ``12``
  419. This notification is deprecated and is no longer emitted. Use :ref:`NOTIFICATION_CHILD_ORDER_CHANGED<class_Node_constant_NOTIFICATION_CHILD_ORDER_CHANGED>` instead.
  420. .. _class_Node_constant_NOTIFICATION_READY:
  421. .. rst-class:: classref-constant
  422. **NOTIFICATION_READY** = ``13``
  423. Notification received when the node is ready. See :ref:`_ready<class_Node_method__ready>`.
  424. .. _class_Node_constant_NOTIFICATION_PAUSED:
  425. .. rst-class:: classref-constant
  426. **NOTIFICATION_PAUSED** = ``14``
  427. Notification received when the node is paused.
  428. .. _class_Node_constant_NOTIFICATION_UNPAUSED:
  429. .. rst-class:: classref-constant
  430. **NOTIFICATION_UNPAUSED** = ``15``
  431. Notification received when the node is unpaused.
  432. .. _class_Node_constant_NOTIFICATION_PHYSICS_PROCESS:
  433. .. rst-class:: classref-constant
  434. **NOTIFICATION_PHYSICS_PROCESS** = ``16``
  435. Notification received every frame when the physics process flag is set (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  436. .. _class_Node_constant_NOTIFICATION_PROCESS:
  437. .. rst-class:: classref-constant
  438. **NOTIFICATION_PROCESS** = ``17``
  439. Notification received every frame when the process flag is set (see :ref:`set_process<class_Node_method_set_process>`).
  440. .. _class_Node_constant_NOTIFICATION_PARENTED:
  441. .. rst-class:: classref-constant
  442. **NOTIFICATION_PARENTED** = ``18``
  443. Notification received when a node is set as a child of another node.
  444. \ **Note:** This doesn't mean that a node entered the :ref:`SceneTree<class_SceneTree>`.
  445. .. _class_Node_constant_NOTIFICATION_UNPARENTED:
  446. .. rst-class:: classref-constant
  447. **NOTIFICATION_UNPARENTED** = ``19``
  448. Notification received when a node is unparented (parent removed it from the list of children).
  449. .. _class_Node_constant_NOTIFICATION_SCENE_INSTANTIATED:
  450. .. rst-class:: classref-constant
  451. **NOTIFICATION_SCENE_INSTANTIATED** = ``20``
  452. Notification received by scene owner when its scene is instantiated.
  453. .. _class_Node_constant_NOTIFICATION_DRAG_BEGIN:
  454. .. rst-class:: classref-constant
  455. **NOTIFICATION_DRAG_BEGIN** = ``21``
  456. Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one.
  457. 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>`.
  458. Use :ref:`Viewport.gui_get_drag_data<class_Viewport_method_gui_get_drag_data>` to get the dragged data.
  459. .. _class_Node_constant_NOTIFICATION_DRAG_END:
  460. .. rst-class:: classref-constant
  461. **NOTIFICATION_DRAG_END** = ``22``
  462. Notification received when a drag operation ends.
  463. Use :ref:`Viewport.gui_is_drag_successful<class_Viewport_method_gui_is_drag_successful>` to check if the drag succeeded.
  464. .. _class_Node_constant_NOTIFICATION_PATH_RENAMED:
  465. .. rst-class:: classref-constant
  466. **NOTIFICATION_PATH_RENAMED** = ``23``
  467. 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.
  468. .. _class_Node_constant_NOTIFICATION_CHILD_ORDER_CHANGED:
  469. .. rst-class:: classref-constant
  470. **NOTIFICATION_CHILD_ORDER_CHANGED** = ``24``
  471. Notification received when the list of children is changed. This happens when child nodes are added, moved or removed.
  472. .. _class_Node_constant_NOTIFICATION_INTERNAL_PROCESS:
  473. .. rst-class:: classref-constant
  474. **NOTIFICATION_INTERNAL_PROCESS** = ``25``
  475. Notification received every frame when the internal process flag is set (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  476. .. _class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS:
  477. .. rst-class:: classref-constant
  478. **NOTIFICATION_INTERNAL_PHYSICS_PROCESS** = ``26``
  479. 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>`).
  480. .. _class_Node_constant_NOTIFICATION_POST_ENTER_TREE:
  481. .. rst-class:: classref-constant
  482. **NOTIFICATION_POST_ENTER_TREE** = ``27``
  483. 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.
  484. .. _class_Node_constant_NOTIFICATION_DISABLED:
  485. .. rst-class:: classref-constant
  486. **NOTIFICATION_DISABLED** = ``28``
  487. Notification received when the node is disabled. See :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  488. .. _class_Node_constant_NOTIFICATION_ENABLED:
  489. .. rst-class:: classref-constant
  490. **NOTIFICATION_ENABLED** = ``29``
  491. Notification received when the node is enabled again after being disabled. See :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  492. .. _class_Node_constant_NOTIFICATION_NODE_RECACHE_REQUESTED:
  493. .. rst-class:: classref-constant
  494. **NOTIFICATION_NODE_RECACHE_REQUESTED** = ``30``
  495. Notification received when other nodes in the tree may have been removed/replaced and node pointers may require re-caching.
  496. .. _class_Node_constant_NOTIFICATION_EDITOR_PRE_SAVE:
  497. .. rst-class:: classref-constant
  498. **NOTIFICATION_EDITOR_PRE_SAVE** = ``9001``
  499. 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.
  500. .. _class_Node_constant_NOTIFICATION_EDITOR_POST_SAVE:
  501. .. rst-class:: classref-constant
  502. **NOTIFICATION_EDITOR_POST_SAVE** = ``9002``
  503. 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.
  504. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_ENTER:
  505. .. rst-class:: classref-constant
  506. **NOTIFICATION_WM_MOUSE_ENTER** = ``1002``
  507. Notification received from the OS when the mouse enters the game window.
  508. Implemented on desktop and web platforms.
  509. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_EXIT:
  510. .. rst-class:: classref-constant
  511. **NOTIFICATION_WM_MOUSE_EXIT** = ``1003``
  512. Notification received from the OS when the mouse leaves the game window.
  513. Implemented on desktop and web platforms.
  514. .. _class_Node_constant_NOTIFICATION_WM_WINDOW_FOCUS_IN:
  515. .. rst-class:: classref-constant
  516. **NOTIFICATION_WM_WINDOW_FOCUS_IN** = ``1004``
  517. Notification received from the OS 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).
  518. .. _class_Node_constant_NOTIFICATION_WM_WINDOW_FOCUS_OUT:
  519. .. rst-class:: classref-constant
  520. **NOTIFICATION_WM_WINDOW_FOCUS_OUT** = ``1005``
  521. Notification received from the OS 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).
  522. .. _class_Node_constant_NOTIFICATION_WM_CLOSE_REQUEST:
  523. .. rst-class:: classref-constant
  524. **NOTIFICATION_WM_CLOSE_REQUEST** = ``1006``
  525. Notification received from the OS when a close request is sent (e.g. closing the window with a "Close" button or :kbd:`Alt + F4`).
  526. Implemented on desktop platforms.
  527. .. _class_Node_constant_NOTIFICATION_WM_GO_BACK_REQUEST:
  528. .. rst-class:: classref-constant
  529. **NOTIFICATION_WM_GO_BACK_REQUEST** = ``1007``
  530. Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
  531. Specific to the Android platform.
  532. .. _class_Node_constant_NOTIFICATION_WM_SIZE_CHANGED:
  533. .. rst-class:: classref-constant
  534. **NOTIFICATION_WM_SIZE_CHANGED** = ``1008``
  535. Notification received from the OS when the window is resized.
  536. .. _class_Node_constant_NOTIFICATION_WM_DPI_CHANGE:
  537. .. rst-class:: classref-constant
  538. **NOTIFICATION_WM_DPI_CHANGE** = ``1009``
  539. Notification received from the OS when the screen's DPI has been changed. Only implemented on macOS.
  540. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_ENTER:
  541. .. rst-class:: classref-constant
  542. **NOTIFICATION_VP_MOUSE_ENTER** = ``1010``
  543. Notification received when the mouse enters the viewport.
  544. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_EXIT:
  545. .. rst-class:: classref-constant
  546. **NOTIFICATION_VP_MOUSE_EXIT** = ``1011``
  547. Notification received when the mouse leaves the viewport.
  548. .. _class_Node_constant_NOTIFICATION_OS_MEMORY_WARNING:
  549. .. rst-class:: classref-constant
  550. **NOTIFICATION_OS_MEMORY_WARNING** = ``2009``
  551. Notification received from the OS when the application is exceeding its allocated memory.
  552. Specific to the iOS platform.
  553. .. _class_Node_constant_NOTIFICATION_TRANSLATION_CHANGED:
  554. .. rst-class:: classref-constant
  555. **NOTIFICATION_TRANSLATION_CHANGED** = ``2010``
  556. 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>`.
  557. .. _class_Node_constant_NOTIFICATION_WM_ABOUT:
  558. .. rst-class:: classref-constant
  559. **NOTIFICATION_WM_ABOUT** = ``2011``
  560. Notification received from the OS when a request for "About" information is sent.
  561. Specific to the macOS platform.
  562. .. _class_Node_constant_NOTIFICATION_CRASH:
  563. .. rst-class:: classref-constant
  564. **NOTIFICATION_CRASH** = ``2012``
  565. Notification received from Godot's crash handler when the engine is about to crash.
  566. Implemented on desktop platforms if the crash handler is enabled.
  567. .. _class_Node_constant_NOTIFICATION_OS_IME_UPDATE:
  568. .. rst-class:: classref-constant
  569. **NOTIFICATION_OS_IME_UPDATE** = ``2013``
  570. Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
  571. Specific to the macOS platform.
  572. .. _class_Node_constant_NOTIFICATION_APPLICATION_RESUMED:
  573. .. rst-class:: classref-constant
  574. **NOTIFICATION_APPLICATION_RESUMED** = ``2014``
  575. Notification received from the OS when the application is resumed.
  576. Specific to the Android platform.
  577. .. _class_Node_constant_NOTIFICATION_APPLICATION_PAUSED:
  578. .. rst-class:: classref-constant
  579. **NOTIFICATION_APPLICATION_PAUSED** = ``2015``
  580. Notification received from the OS when the application is paused.
  581. Specific to the Android platform.
  582. .. _class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_IN:
  583. .. rst-class:: classref-constant
  584. **NOTIFICATION_APPLICATION_FOCUS_IN** = ``2016``
  585. 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.
  586. Implemented on desktop platforms.
  587. .. _class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_OUT:
  588. .. rst-class:: classref-constant
  589. **NOTIFICATION_APPLICATION_FOCUS_OUT** = ``2017``
  590. 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.
  591. Implemented on desktop platforms.
  592. .. _class_Node_constant_NOTIFICATION_TEXT_SERVER_CHANGED:
  593. .. rst-class:: classref-constant
  594. **NOTIFICATION_TEXT_SERVER_CHANGED** = ``2018``
  595. Notification received when text server is changed.
  596. .. rst-class:: classref-section-separator
  597. ----
  598. .. rst-class:: classref-descriptions-group
  599. Property Descriptions
  600. ---------------------
  601. .. _class_Node_property_editor_description:
  602. .. rst-class:: classref-property
  603. :ref:`String<class_String>` **editor_description** = ``""``
  604. .. rst-class:: classref-property-setget
  605. - void **set_editor_description** **(** :ref:`String<class_String>` value **)**
  606. - :ref:`String<class_String>` **get_editor_description** **(** **)**
  607. Add a custom description to a node. It will be displayed in a tooltip when hovered in editor's scene tree.
  608. .. rst-class:: classref-item-separator
  609. ----
  610. .. _class_Node_property_multiplayer:
  611. .. rst-class:: classref-property
  612. :ref:`MultiplayerAPI<class_MultiplayerAPI>` **multiplayer**
  613. .. rst-class:: classref-property-setget
  614. - :ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_multiplayer** **(** **)**
  615. The :ref:`MultiplayerAPI<class_MultiplayerAPI>` instance associated with this node. See :ref:`SceneTree.get_multiplayer<class_SceneTree_method_get_multiplayer>`.
  616. .. rst-class:: classref-item-separator
  617. ----
  618. .. _class_Node_property_name:
  619. .. rst-class:: classref-property
  620. :ref:`StringName<class_StringName>` **name**
  621. .. rst-class:: classref-property-setget
  622. - void **set_name** **(** :ref:`StringName<class_StringName>` value **)**
  623. - :ref:`StringName<class_StringName>` **get_name** **(** **)**
  624. 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.
  625. \ **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.
  626. .. rst-class:: classref-item-separator
  627. ----
  628. .. _class_Node_property_owner:
  629. .. rst-class:: classref-property
  630. :ref:`Node<class_Node>` **owner**
  631. .. rst-class:: classref-property-setget
  632. - void **set_owner** **(** :ref:`Node<class_Node>` value **)**
  633. - :ref:`Node<class_Node>` **get_owner** **(** **)**
  634. The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). 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 :ref:`SceneTree<class_SceneTree>`\ s, with instancing and subinstancing.
  635. \ **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.
  636. .. rst-class:: classref-item-separator
  637. ----
  638. .. _class_Node_property_process_mode:
  639. .. rst-class:: classref-property
  640. :ref:`ProcessMode<enum_Node_ProcessMode>` **process_mode** = ``0``
  641. .. rst-class:: classref-property-setget
  642. - void **set_process_mode** **(** :ref:`ProcessMode<enum_Node_ProcessMode>` value **)**
  643. - :ref:`ProcessMode<enum_Node_ProcessMode>` **get_process_mode** **(** **)**
  644. 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).
  645. .. rst-class:: classref-item-separator
  646. ----
  647. .. _class_Node_property_process_physics_priority:
  648. .. rst-class:: classref-property
  649. :ref:`int<class_int>` **process_physics_priority** = ``0``
  650. .. rst-class:: classref-property-setget
  651. - void **set_physics_process_priority** **(** :ref:`int<class_int>` value **)**
  652. - :ref:`int<class_int>` **get_physics_process_priority** **(** **)**
  653. 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.
  654. .. rst-class:: classref-item-separator
  655. ----
  656. .. _class_Node_property_process_priority:
  657. .. rst-class:: classref-property
  658. :ref:`int<class_int>` **process_priority** = ``0``
  659. .. rst-class:: classref-property-setget
  660. - void **set_process_priority** **(** :ref:`int<class_int>` value **)**
  661. - :ref:`int<class_int>` **get_process_priority** **(** **)**
  662. 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.
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_Node_property_process_thread_group:
  666. .. rst-class:: classref-property
  667. :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **process_thread_group** = ``0``
  668. .. rst-class:: classref-property-setget
  669. - void **set_process_thread_group** **(** :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` value **)**
  670. - :ref:`ProcessThreadGroup<enum_Node_ProcessThreadGroup>` **get_process_thread_group** **(** **)**
  671. 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.
  672. 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.
  673. 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).
  674. 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 children (and grandchildren) 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.
  675. .. rst-class:: classref-item-separator
  676. ----
  677. .. _class_Node_property_process_thread_group_order:
  678. .. rst-class:: classref-property
  679. :ref:`int<class_int>` **process_thread_group_order**
  680. .. rst-class:: classref-property-setget
  681. - void **set_process_thread_group_order** **(** :ref:`int<class_int>` value **)**
  682. - :ref:`int<class_int>` **get_process_thread_group_order** **(** **)**
  683. 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.
  684. .. rst-class:: classref-item-separator
  685. ----
  686. .. _class_Node_property_process_thread_messages:
  687. .. rst-class:: classref-property
  688. :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **process_thread_messages**
  689. .. rst-class:: classref-property-setget
  690. - void **set_process_thread_messages** **(** :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` value **)**
  691. - :ref:`ProcessThreadMessages<enum_Node_ProcessThreadMessages>` **get_process_thread_messages** **(** **)**
  692. 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.
  693. .. rst-class:: classref-item-separator
  694. ----
  695. .. _class_Node_property_scene_file_path:
  696. .. rst-class:: classref-property
  697. :ref:`String<class_String>` **scene_file_path**
  698. .. rst-class:: classref-property-setget
  699. - void **set_scene_file_path** **(** :ref:`String<class_String>` value **)**
  700. - :ref:`String<class_String>` **get_scene_file_path** **(** **)**
  701. 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.
  702. .. rst-class:: classref-item-separator
  703. ----
  704. .. _class_Node_property_unique_name_in_owner:
  705. .. rst-class:: classref-property
  706. :ref:`bool<class_bool>` **unique_name_in_owner** = ``false``
  707. .. rst-class:: classref-property-setget
  708. - void **set_unique_name_in_owner** **(** :ref:`bool<class_bool>` value **)**
  709. - :ref:`bool<class_bool>` **is_unique_name_in_owner** **(** **)**
  710. 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.
  711. 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.
  712. .. rst-class:: classref-section-separator
  713. ----
  714. .. rst-class:: classref-descriptions-group
  715. Method Descriptions
  716. -------------------
  717. .. _class_Node_method__enter_tree:
  718. .. rst-class:: classref-method
  719. void **_enter_tree** **(** **)** |virtual|
  720. 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.
  721. Corresponds to the :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  722. .. rst-class:: classref-item-separator
  723. ----
  724. .. _class_Node_method__exit_tree:
  725. .. rst-class:: classref-method
  726. void **_exit_tree** **(** **)** |virtual|
  727. 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.
  728. 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>`.
  729. .. rst-class:: classref-item-separator
  730. ----
  731. .. _class_Node_method__get_configuration_warnings:
  732. .. rst-class:: classref-method
  733. :ref:`PackedStringArray<class_PackedStringArray>` **_get_configuration_warnings** **(** **)** |virtual| |const|
  734. 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.
  735. Returning an empty array produces no warnings.
  736. Call :ref:`update_configuration_warnings<class_Node_method_update_configuration_warnings>` when the warnings need to be updated for this node.
  737. ::
  738. @export var energy = 0:
  739. set(value):
  740. energy = value
  741. update_configuration_warnings()
  742. func _get_configuration_warnings():
  743. if energy < 0:
  744. return ["Energy must be 0 or greater."]
  745. else:
  746. return []
  747. .. rst-class:: classref-item-separator
  748. ----
  749. .. _class_Node_method__input:
  750. .. rst-class:: classref-method
  751. void **_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  752. Called when there is an input event. The input event propagates up through the node tree until a node consumes it.
  753. 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>`.
  754. 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.
  755. 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.
  756. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  757. .. rst-class:: classref-item-separator
  758. ----
  759. .. _class_Node_method__physics_process:
  760. .. rst-class:: classref-method
  761. void **_physics_process** **(** :ref:`float<class_float>` delta **)** |virtual|
  762. 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.
  763. 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>`.
  764. Corresponds to the :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  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__process:
  769. .. rst-class:: classref-method
  770. void **_process** **(** :ref:`float<class_float>` delta **)** |virtual|
  771. 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.
  772. 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>`.
  773. Corresponds to the :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_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__ready:
  778. .. rst-class:: classref-method
  779. void **_ready** **(** **)** |virtual|
  780. 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.
  781. 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.
  782. 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>`.
  783. \ **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.
  784. .. rst-class:: classref-item-separator
  785. ----
  786. .. _class_Node_method__shortcut_input:
  787. .. rst-class:: classref-method
  788. void **_shortcut_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  789. Called when an :ref:`InputEventKey<class_InputEventKey>` or :ref:`InputEventShortcut<class_InputEventShortcut>` 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.
  790. 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>`.
  791. 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.
  792. This method can be used to handle shortcuts.
  793. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
  794. .. rst-class:: classref-item-separator
  795. ----
  796. .. _class_Node_method__unhandled_input:
  797. .. rst-class:: classref-method
  798. void **_unhandled_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  799. 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.
  800. 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>`.
  801. 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.
  802. 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.
  803. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  804. .. rst-class:: classref-item-separator
  805. ----
  806. .. _class_Node_method__unhandled_key_input:
  807. .. rst-class:: classref-method
  808. void **_unhandled_key_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  809. 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.
  810. 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>`.
  811. 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.
  812. 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.
  813. 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.
  814. 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.
  815. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  816. .. rst-class:: classref-item-separator
  817. ----
  818. .. _class_Node_method_add_child:
  819. .. rst-class:: classref-method
  820. void **add_child** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` force_readable_name=false, :ref:`InternalMode<enum_Node_InternalMode>` internal=0 **)**
  821. 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.
  822. 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.
  823. 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.
  824. \ **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:
  825. .. tabs::
  826. .. code-tab:: gdscript
  827. var child_node = get_child(0)
  828. if child_node.get_parent():
  829. child_node.get_parent().remove_child(child_node)
  830. add_child(child_node)
  831. .. code-tab:: csharp
  832. Node childNode = GetChild(0);
  833. if (childNode.GetParent() != null)
  834. {
  835. childNode.GetParent().RemoveChild(childNode);
  836. }
  837. AddChild(childNode);
  838. 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.
  839. \ **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.
  840. .. rst-class:: classref-item-separator
  841. ----
  842. .. _class_Node_method_add_sibling:
  843. .. rst-class:: classref-method
  844. void **add_sibling** **(** :ref:`Node<class_Node>` sibling, :ref:`bool<class_bool>` force_readable_name=false **)**
  845. Adds a ``sibling`` node to current's node parent, at the same level as that node, right below it.
  846. 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.
  847. 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.
  848. \ **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>`).
  849. .. rst-class:: classref-item-separator
  850. ----
  851. .. _class_Node_method_add_to_group:
  852. .. rst-class:: classref-method
  853. void **add_to_group** **(** :ref:`StringName<class_StringName>` group, :ref:`bool<class_bool>` persistent=false **)**
  854. 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>`.
  855. The ``persistent`` option is used when packing node to :ref:`PackedScene<class_PackedScene>` and saving to file. Non-persistent groups aren't stored.
  856. \ **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.
  857. .. rst-class:: classref-item-separator
  858. ----
  859. .. _class_Node_method_call_deferred_thread_group:
  860. .. rst-class:: classref-method
  861. :ref:`Variant<class_Variant>` **call_deferred_thread_group** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  862. 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.
  863. .. rst-class:: classref-item-separator
  864. ----
  865. .. _class_Node_method_call_thread_safe:
  866. .. rst-class:: classref-method
  867. :ref:`Variant<class_Variant>` **call_thread_safe** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  868. 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.
  869. .. rst-class:: classref-item-separator
  870. ----
  871. .. _class_Node_method_can_process:
  872. .. rst-class:: classref-method
  873. :ref:`bool<class_bool>` **can_process** **(** **)** |const|
  874. 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.
  875. .. rst-class:: classref-item-separator
  876. ----
  877. .. _class_Node_method_create_tween:
  878. .. rst-class:: classref-method
  879. :ref:`Tween<class_Tween>` **create_tween** **(** **)**
  880. Creates a new :ref:`Tween<class_Tween>` and binds it to this node. This is equivalent of doing:
  881. .. tabs::
  882. .. code-tab:: gdscript
  883. get_tree().create_tween().bind_node(self)
  884. .. code-tab:: csharp
  885. GetTree().CreateTween().BindNode(this);
  886. The Tween will start automatically on the next process frame or physics frame (depending on :ref:`TweenProcessMode<enum_Tween_TweenProcessMode>`).
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_Node_method_duplicate:
  890. .. rst-class:: classref-method
  891. :ref:`Node<class_Node>` **duplicate** **(** :ref:`int<class_int>` flags=15 **)** |const|
  892. Duplicates the node, returning a new node.
  893. You can fine-tune the behavior using the ``flags`` (see :ref:`DuplicateFlags<enum_Node_DuplicateFlags>`).
  894. \ **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.
  895. .. rst-class:: classref-item-separator
  896. ----
  897. .. _class_Node_method_find_child:
  898. .. rst-class:: classref-method
  899. :ref:`Node<class_Node>` **find_child** **(** :ref:`String<class_String>` pattern, :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const|
  900. 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>`).
  901. \ ``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 ``"."``).
  902. 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.
  903. 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.
  904. Returns ``null`` if no matching **Node** is found.
  905. \ **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.
  906. \ **Note:** To find all descendant nodes matching a pattern or a class type, see :ref:`find_children<class_Node_method_find_children>`.
  907. .. rst-class:: classref-item-separator
  908. ----
  909. .. _class_Node_method_find_children:
  910. .. rst-class:: classref-method
  911. :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|
  912. 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>`).
  913. \ ``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 ``"."``).
  914. \ ``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.
  915. 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.
  916. 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.
  917. Returns an empty array if no matching nodes are found.
  918. \ **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.
  919. \ **Note:** If you only want to find the first descendant node that matches a pattern, see :ref:`find_child<class_Node_method_find_child>`.
  920. .. rst-class:: classref-item-separator
  921. ----
  922. .. _class_Node_method_find_parent:
  923. .. rst-class:: classref-method
  924. :ref:`Node<class_Node>` **find_parent** **(** :ref:`String<class_String>` pattern **)** |const|
  925. Finds the first parent of the current node whose name matches ``pattern`` as in :ref:`String.match<class_String_method_match>`.
  926. \ ``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 ``"."``).
  927. \ **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.
  928. .. rst-class:: classref-item-separator
  929. ----
  930. .. _class_Node_method_get_child:
  931. .. rst-class:: classref-method
  932. :ref:`Node<class_Node>` **get_child** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` include_internal=false **)** |const|
  933. 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.
  934. Negative indices access the children from the last one.
  935. If ``include_internal`` is ``false``, internal children are skipped (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  936. To access a child node via its name, use :ref:`get_node<class_Node_method_get_node>`.
  937. .. rst-class:: classref-item-separator
  938. ----
  939. .. _class_Node_method_get_child_count:
  940. .. rst-class:: classref-method
  941. :ref:`int<class_int>` **get_child_count** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  942. Returns the number of child nodes.
  943. If ``include_internal`` is ``false``, internal children aren't counted (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  944. .. rst-class:: classref-item-separator
  945. ----
  946. .. _class_Node_method_get_children:
  947. .. rst-class:: classref-method
  948. :ref:`Node[]<class_Node>` **get_children** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  949. Returns an array of references to node's children.
  950. 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>`).
  951. .. rst-class:: classref-item-separator
  952. ----
  953. .. _class_Node_method_get_groups:
  954. .. rst-class:: classref-method
  955. :ref:`StringName[]<class_StringName>` **get_groups** **(** **)** |const|
  956. Returns an array listing the groups that the node is a member of.
  957. \ **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.
  958. \ **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:
  959. .. tabs::
  960. .. code-tab:: gdscript
  961. # Stores the node's non-internal groups only (as an array of Strings).
  962. var non_internal_groups = []
  963. for group in get_groups():
  964. if not group.begins_with("_"):
  965. non_internal_groups.push_back(group)
  966. .. code-tab:: csharp
  967. // Stores the node's non-internal groups only (as a List of strings).
  968. List<string> nonInternalGroups = new List<string>();
  969. foreach (string group in GetGroups())
  970. {
  971. if (!group.BeginsWith("_"))
  972. nonInternalGroups.Add(group);
  973. }
  974. .. rst-class:: classref-item-separator
  975. ----
  976. .. _class_Node_method_get_index:
  977. .. rst-class:: classref-method
  978. :ref:`int<class_int>` **get_index** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  979. Returns the node's order in the scene tree branch. For example, if called on the first child node the position is ``0``.
  980. 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>`).
  981. .. rst-class:: classref-item-separator
  982. ----
  983. .. _class_Node_method_get_last_exclusive_window:
  984. .. rst-class:: classref-method
  985. :ref:`Window<class_Window>` **get_last_exclusive_window** **(** **)** |const|
  986. 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.
  987. .. rst-class:: classref-item-separator
  988. ----
  989. .. _class_Node_method_get_multiplayer_authority:
  990. .. rst-class:: classref-method
  991. :ref:`int<class_int>` **get_multiplayer_authority** **(** **)** |const|
  992. Returns the peer ID of the multiplayer authority for this node. See :ref:`set_multiplayer_authority<class_Node_method_set_multiplayer_authority>`.
  993. .. rst-class:: classref-item-separator
  994. ----
  995. .. _class_Node_method_get_node:
  996. .. rst-class:: classref-method
  997. :ref:`Node<class_Node>` **get_node** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  998. 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.
  999. \ **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>`).
  1000. \ **Example:** Assume your current node is Character and the following tree:
  1001. ::
  1002. /root
  1003. /root/Character
  1004. /root/Character/Sword
  1005. /root/Character/Backpack/Dagger
  1006. /root/MyGame
  1007. /root/Swamp/Alligator
  1008. /root/Swamp/Mosquito
  1009. /root/Swamp/Goblin
  1010. Possible paths are:
  1011. .. tabs::
  1012. .. code-tab:: gdscript
  1013. get_node("Sword")
  1014. get_node("Backpack/Dagger")
  1015. get_node("../Swamp/Alligator")
  1016. get_node("/root/MyGame")
  1017. .. code-tab:: csharp
  1018. GetNode("Sword");
  1019. GetNode("Backpack/Dagger");
  1020. GetNode("../Swamp/Alligator");
  1021. GetNode("/root/MyGame");
  1022. .. rst-class:: classref-item-separator
  1023. ----
  1024. .. _class_Node_method_get_node_and_resource:
  1025. .. rst-class:: classref-method
  1026. :ref:`Array<class_Array>` **get_node_and_resource** **(** :ref:`NodePath<class_NodePath>` path **)**
  1027. 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.
  1028. 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.
  1029. 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:
  1030. .. tabs::
  1031. .. code-tab:: gdscript
  1032. print(get_node_and_resource("Area2D/CollisionShape2D")) # [[CollisionShape2D:1161], Null, ]
  1033. print(get_node_and_resource("Area2D/CollisionShape2D:shape")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
  1034. print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
  1035. .. code-tab:: csharp
  1036. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D")); // [[CollisionShape2D:1161], Null, ]
  1037. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
  1038. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape:extents")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
  1039. .. rst-class:: classref-item-separator
  1040. ----
  1041. .. _class_Node_method_get_node_or_null:
  1042. .. rst-class:: classref-method
  1043. :ref:`Node<class_Node>` **get_node_or_null** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  1044. 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**.
  1045. .. rst-class:: classref-item-separator
  1046. ----
  1047. .. _class_Node_method_get_parent:
  1048. .. rst-class:: classref-method
  1049. :ref:`Node<class_Node>` **get_parent** **(** **)** |const|
  1050. Returns the parent node of the current node, or ``null`` if the node lacks a parent.
  1051. .. rst-class:: classref-item-separator
  1052. ----
  1053. .. _class_Node_method_get_path:
  1054. .. rst-class:: classref-method
  1055. :ref:`NodePath<class_NodePath>` **get_path** **(** **)** |const|
  1056. 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>`).
  1057. .. rst-class:: classref-item-separator
  1058. ----
  1059. .. _class_Node_method_get_path_to:
  1060. .. rst-class:: classref-method
  1061. :ref:`NodePath<class_NodePath>` **get_path_to** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` use_unique_path=false **)** |const|
  1062. 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.
  1063. If ``use_unique_path`` is ``true``, returns the shortest path considering unique node.
  1064. \ **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.
  1065. .. rst-class:: classref-item-separator
  1066. ----
  1067. .. _class_Node_method_get_physics_process_delta_time:
  1068. .. rst-class:: classref-method
  1069. :ref:`float<class_float>` **get_physics_process_delta_time** **(** **)** |const|
  1070. 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>`.
  1071. .. rst-class:: classref-item-separator
  1072. ----
  1073. .. _class_Node_method_get_process_delta_time:
  1074. .. rst-class:: classref-method
  1075. :ref:`float<class_float>` **get_process_delta_time** **(** **)** |const|
  1076. Returns the time elapsed (in seconds) since the last process callback. This value may vary from frame to frame.
  1077. .. rst-class:: classref-item-separator
  1078. ----
  1079. .. _class_Node_method_get_scene_instance_load_placeholder:
  1080. .. rst-class:: classref-method
  1081. :ref:`bool<class_bool>` **get_scene_instance_load_placeholder** **(** **)** |const|
  1082. Returns ``true`` if this is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
  1083. .. rst-class:: classref-item-separator
  1084. ----
  1085. .. _class_Node_method_get_tree:
  1086. .. rst-class:: classref-method
  1087. :ref:`SceneTree<class_SceneTree>` **get_tree** **(** **)** |const|
  1088. Returns the :ref:`SceneTree<class_SceneTree>` that contains this node.
  1089. .. rst-class:: classref-item-separator
  1090. ----
  1091. .. _class_Node_method_get_viewport:
  1092. .. rst-class:: classref-method
  1093. :ref:`Viewport<class_Viewport>` **get_viewport** **(** **)** |const|
  1094. Returns the node's :ref:`Viewport<class_Viewport>`.
  1095. .. rst-class:: classref-item-separator
  1096. ----
  1097. .. _class_Node_method_get_window:
  1098. .. rst-class:: classref-method
  1099. :ref:`Window<class_Window>` **get_window** **(** **)** |const|
  1100. 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()``).
  1101. .. rst-class:: classref-item-separator
  1102. ----
  1103. .. _class_Node_method_has_node:
  1104. .. rst-class:: classref-method
  1105. :ref:`bool<class_bool>` **has_node** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  1106. Returns ``true`` if the node that the :ref:`NodePath<class_NodePath>` points to exists.
  1107. .. rst-class:: classref-item-separator
  1108. ----
  1109. .. _class_Node_method_has_node_and_resource:
  1110. .. rst-class:: classref-method
  1111. :ref:`bool<class_bool>` **has_node_and_resource** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  1112. 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.
  1113. .. rst-class:: classref-item-separator
  1114. ----
  1115. .. _class_Node_method_is_ancestor_of:
  1116. .. rst-class:: classref-method
  1117. :ref:`bool<class_bool>` **is_ancestor_of** **(** :ref:`Node<class_Node>` node **)** |const|
  1118. Returns ``true`` if the given node is a direct or indirect child of the current node.
  1119. .. rst-class:: classref-item-separator
  1120. ----
  1121. .. _class_Node_method_is_displayed_folded:
  1122. .. rst-class:: classref-method
  1123. :ref:`bool<class_bool>` **is_displayed_folded** **(** **)** |const|
  1124. Returns ``true`` if the node is folded (collapsed) in the Scene dock. This method is only intended for use with editor tooling.
  1125. .. rst-class:: classref-item-separator
  1126. ----
  1127. .. _class_Node_method_is_editable_instance:
  1128. .. rst-class:: classref-method
  1129. :ref:`bool<class_bool>` **is_editable_instance** **(** :ref:`Node<class_Node>` node **)** |const|
  1130. Returns ``true`` if ``node`` has editable children enabled relative to this node. This method is only intended for use with editor tooling.
  1131. .. rst-class:: classref-item-separator
  1132. ----
  1133. .. _class_Node_method_is_greater_than:
  1134. .. rst-class:: classref-method
  1135. :ref:`bool<class_bool>` **is_greater_than** **(** :ref:`Node<class_Node>` node **)** |const|
  1136. Returns ``true`` if the given node occurs later in the scene hierarchy than the current node.
  1137. .. rst-class:: classref-item-separator
  1138. ----
  1139. .. _class_Node_method_is_in_group:
  1140. .. rst-class:: classref-method
  1141. :ref:`bool<class_bool>` **is_in_group** **(** :ref:`StringName<class_StringName>` group **)** |const|
  1142. Returns ``true`` if this node is in the specified group. See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  1143. .. rst-class:: classref-item-separator
  1144. ----
  1145. .. _class_Node_method_is_inside_tree:
  1146. .. rst-class:: classref-method
  1147. :ref:`bool<class_bool>` **is_inside_tree** **(** **)** |const|
  1148. Returns ``true`` if this node is currently inside a :ref:`SceneTree<class_SceneTree>`.
  1149. .. rst-class:: classref-item-separator
  1150. ----
  1151. .. _class_Node_method_is_multiplayer_authority:
  1152. .. rst-class:: classref-method
  1153. :ref:`bool<class_bool>` **is_multiplayer_authority** **(** **)** |const|
  1154. Returns ``true`` if the local system is the multiplayer authority of this node.
  1155. .. rst-class:: classref-item-separator
  1156. ----
  1157. .. _class_Node_method_is_node_ready:
  1158. .. rst-class:: classref-method
  1159. :ref:`bool<class_bool>` **is_node_ready** **(** **)** |const|
  1160. Returns ``true`` if the node is ready, i.e. it's inside scene tree and all its children are initialized.
  1161. \ :ref:`request_ready<class_Node_method_request_ready>` resets it back to ``false``.
  1162. .. rst-class:: classref-item-separator
  1163. ----
  1164. .. _class_Node_method_is_physics_processing:
  1165. .. rst-class:: classref-method
  1166. :ref:`bool<class_bool>` **is_physics_processing** **(** **)** |const|
  1167. Returns ``true`` if physics processing is enabled (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  1168. .. rst-class:: classref-item-separator
  1169. ----
  1170. .. _class_Node_method_is_physics_processing_internal:
  1171. .. rst-class:: classref-method
  1172. :ref:`bool<class_bool>` **is_physics_processing_internal** **(** **)** |const|
  1173. Returns ``true`` if internal physics processing is enabled (see :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>`).
  1174. .. rst-class:: classref-item-separator
  1175. ----
  1176. .. _class_Node_method_is_processing:
  1177. .. rst-class:: classref-method
  1178. :ref:`bool<class_bool>` **is_processing** **(** **)** |const|
  1179. Returns ``true`` if processing is enabled (see :ref:`set_process<class_Node_method_set_process>`).
  1180. .. rst-class:: classref-item-separator
  1181. ----
  1182. .. _class_Node_method_is_processing_input:
  1183. .. rst-class:: classref-method
  1184. :ref:`bool<class_bool>` **is_processing_input** **(** **)** |const|
  1185. Returns ``true`` if the node is processing input (see :ref:`set_process_input<class_Node_method_set_process_input>`).
  1186. .. rst-class:: classref-item-separator
  1187. ----
  1188. .. _class_Node_method_is_processing_internal:
  1189. .. rst-class:: classref-method
  1190. :ref:`bool<class_bool>` **is_processing_internal** **(** **)** |const|
  1191. Returns ``true`` if internal processing is enabled (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  1192. .. rst-class:: classref-item-separator
  1193. ----
  1194. .. _class_Node_method_is_processing_shortcut_input:
  1195. .. rst-class:: classref-method
  1196. :ref:`bool<class_bool>` **is_processing_shortcut_input** **(** **)** |const|
  1197. Returns ``true`` if the node is processing shortcuts (see :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>`).
  1198. .. rst-class:: classref-item-separator
  1199. ----
  1200. .. _class_Node_method_is_processing_unhandled_input:
  1201. .. rst-class:: classref-method
  1202. :ref:`bool<class_bool>` **is_processing_unhandled_input** **(** **)** |const|
  1203. Returns ``true`` if the node is processing unhandled input (see :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>`).
  1204. .. rst-class:: classref-item-separator
  1205. ----
  1206. .. _class_Node_method_is_processing_unhandled_key_input:
  1207. .. rst-class:: classref-method
  1208. :ref:`bool<class_bool>` **is_processing_unhandled_key_input** **(** **)** |const|
  1209. 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>`).
  1210. .. rst-class:: classref-item-separator
  1211. ----
  1212. .. _class_Node_method_move_child:
  1213. .. rst-class:: classref-method
  1214. void **move_child** **(** :ref:`Node<class_Node>` child_node, :ref:`int<class_int>` to_index **)**
  1215. 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.
  1216. \ **Note:** Internal children can only be moved within their expected "internal range" (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  1217. .. rst-class:: classref-item-separator
  1218. ----
  1219. .. _class_Node_method_notify_deferred_thread_group:
  1220. .. rst-class:: classref-method
  1221. void **notify_deferred_thread_group** **(** :ref:`int<class_int>` what **)**
  1222. Similar to :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>`, but for notifications.
  1223. .. rst-class:: classref-item-separator
  1224. ----
  1225. .. _class_Node_method_notify_thread_safe:
  1226. .. rst-class:: classref-method
  1227. void **notify_thread_safe** **(** :ref:`int<class_int>` what **)**
  1228. Similar to :ref:`call_thread_safe<class_Node_method_call_thread_safe>`, but for notifications.
  1229. .. rst-class:: classref-item-separator
  1230. ----
  1231. .. _class_Node_method_print_orphan_nodes:
  1232. .. rst-class:: classref-method
  1233. void **print_orphan_nodes** **(** **)** |static|
  1234. Prints all orphan nodes (nodes outside the :ref:`SceneTree<class_SceneTree>`). Used for debugging.
  1235. \ **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.
  1236. .. rst-class:: classref-item-separator
  1237. ----
  1238. .. _class_Node_method_print_tree:
  1239. .. rst-class:: classref-method
  1240. void **print_tree** **(** **)**
  1241. 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.
  1242. \ **Example output:**\
  1243. ::
  1244. TheGame
  1245. TheGame/Menu
  1246. TheGame/Menu/Label
  1247. TheGame/Menu/Camera2D
  1248. TheGame/SplashScreen
  1249. TheGame/SplashScreen/Camera2D
  1250. .. rst-class:: classref-item-separator
  1251. ----
  1252. .. _class_Node_method_print_tree_pretty:
  1253. .. rst-class:: classref-method
  1254. void **print_tree_pretty** **(** **)**
  1255. 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.
  1256. \ **Example output:**\
  1257. ::
  1258. ┖╴TheGame
  1259. ┠╴Menu
  1260. ┃ ┠╴Label
  1261. ┃ ┖╴Camera2D
  1262. ┖╴SplashScreen
  1263. ┖╴Camera2D
  1264. .. rst-class:: classref-item-separator
  1265. ----
  1266. .. _class_Node_method_propagate_call:
  1267. .. rst-class:: classref-method
  1268. void **propagate_call** **(** :ref:`StringName<class_StringName>` method, :ref:`Array<class_Array>` args=[], :ref:`bool<class_bool>` parent_first=false **)**
  1269. 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.
  1270. .. rst-class:: classref-item-separator
  1271. ----
  1272. .. _class_Node_method_propagate_notification:
  1273. .. rst-class:: classref-method
  1274. void **propagate_notification** **(** :ref:`int<class_int>` what **)**
  1275. Notifies the current node and all its children recursively by calling :ref:`Object.notification<class_Object_method_notification>` on all of them.
  1276. .. rst-class:: classref-item-separator
  1277. ----
  1278. .. _class_Node_method_queue_free:
  1279. .. rst-class:: classref-method
  1280. void **queue_free** **(** **)**
  1281. Queues a node for deletion at the end of the current frame. When deleted, all of its child nodes will be deleted as well. This method ensures it's safe to delete the node, contrary to :ref:`Object.free<class_Object_method_free>`. 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.
  1282. .. rst-class:: classref-item-separator
  1283. ----
  1284. .. _class_Node_method_remove_child:
  1285. .. rst-class:: classref-method
  1286. void **remove_child** **(** :ref:`Node<class_Node>` node **)**
  1287. Removes a child node. The node is NOT deleted and must be deleted manually.
  1288. \ **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.
  1289. .. rst-class:: classref-item-separator
  1290. ----
  1291. .. _class_Node_method_remove_from_group:
  1292. .. rst-class:: classref-method
  1293. void **remove_from_group** **(** :ref:`StringName<class_StringName>` group **)**
  1294. 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>`.
  1295. .. rst-class:: classref-item-separator
  1296. ----
  1297. .. _class_Node_method_reparent:
  1298. .. rst-class:: classref-method
  1299. void **reparent** **(** :ref:`Node<class_Node>` new_parent, :ref:`bool<class_bool>` keep_global_transform=true **)**
  1300. Changes the parent of this **Node** to the ``new_parent``. The node needs to already have a parent.
  1301. 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).
  1302. .. rst-class:: classref-item-separator
  1303. ----
  1304. .. _class_Node_method_replace_by:
  1305. .. rst-class:: classref-method
  1306. void **replace_by** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` keep_groups=false **)**
  1307. Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost.
  1308. If ``keep_groups`` is ``true``, the ``node`` is added to the same groups that the replaced node is in.
  1309. \ **Note:** The given node will become the new parent of any child nodes that the replaced node had.
  1310. \ **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>`.
  1311. .. rst-class:: classref-item-separator
  1312. ----
  1313. .. _class_Node_method_request_ready:
  1314. .. rst-class:: classref-method
  1315. void **request_ready** **(** **)**
  1316. 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).
  1317. .. rst-class:: classref-item-separator
  1318. ----
  1319. .. _class_Node_method_rpc:
  1320. .. rst-class:: classref-method
  1321. :ref:`Error<enum_@GlobalScope_Error>` **rpc** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  1322. 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``.
  1323. \ **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``.
  1324. .. rst-class:: classref-item-separator
  1325. ----
  1326. .. _class_Node_method_rpc_config:
  1327. .. rst-class:: classref-method
  1328. void **rpc_config** **(** :ref:`StringName<class_StringName>` method, :ref:`Variant<class_Variant>` config **)**
  1329. 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:
  1330. ::
  1331. {
  1332. rpc_mode = MultiplayerAPI.RPCMode,
  1333. transfer_mode = MultiplayerPeer.TranferMode,
  1334. call_local = false,
  1335. channel = 0,
  1336. }
  1337. 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).
  1338. .. rst-class:: classref-item-separator
  1339. ----
  1340. .. _class_Node_method_rpc_id:
  1341. .. rst-class:: classref-method
  1342. :ref:`Error<enum_@GlobalScope_Error>` **rpc_id** **(** :ref:`int<class_int>` peer_id, :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  1343. 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``.
  1344. .. rst-class:: classref-item-separator
  1345. ----
  1346. .. _class_Node_method_set_deferred_thread_group:
  1347. .. rst-class:: classref-method
  1348. void **set_deferred_thread_group** **(** :ref:`StringName<class_StringName>` property, :ref:`Variant<class_Variant>` value **)**
  1349. Similar to :ref:`call_deferred_thread_group<class_Node_method_call_deferred_thread_group>`, but for setting properties.
  1350. .. rst-class:: classref-item-separator
  1351. ----
  1352. .. _class_Node_method_set_display_folded:
  1353. .. rst-class:: classref-method
  1354. void **set_display_folded** **(** :ref:`bool<class_bool>` fold **)**
  1355. Sets the folded state of the node in the Scene dock. This method is only intended for use with editor tooling.
  1356. .. rst-class:: classref-item-separator
  1357. ----
  1358. .. _class_Node_method_set_editable_instance:
  1359. .. rst-class:: classref-method
  1360. void **set_editable_instance** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` is_editable **)**
  1361. Sets the editable children state of ``node`` relative to this node. This method is only intended for use with editor tooling.
  1362. .. rst-class:: classref-item-separator
  1363. ----
  1364. .. _class_Node_method_set_multiplayer_authority:
  1365. .. rst-class:: classref-method
  1366. void **set_multiplayer_authority** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` recursive=true **)**
  1367. 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.
  1368. .. rst-class:: classref-item-separator
  1369. ----
  1370. .. _class_Node_method_set_physics_process:
  1371. .. rst-class:: classref-method
  1372. void **set_physics_process** **(** :ref:`bool<class_bool>` enable **)**
  1373. 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.
  1374. .. rst-class:: classref-item-separator
  1375. ----
  1376. .. _class_Node_method_set_physics_process_internal:
  1377. .. rst-class:: classref-method
  1378. void **set_physics_process_internal** **(** :ref:`bool<class_bool>` enable **)**
  1379. 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.
  1380. \ **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.
  1381. .. rst-class:: classref-item-separator
  1382. ----
  1383. .. _class_Node_method_set_process:
  1384. .. rst-class:: classref-method
  1385. void **set_process** **(** :ref:`bool<class_bool>` enable **)**
  1386. 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.
  1387. .. rst-class:: classref-item-separator
  1388. ----
  1389. .. _class_Node_method_set_process_input:
  1390. .. rst-class:: classref-method
  1391. void **set_process_input** **(** :ref:`bool<class_bool>` enable **)**
  1392. 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.
  1393. .. rst-class:: classref-item-separator
  1394. ----
  1395. .. _class_Node_method_set_process_internal:
  1396. .. rst-class:: classref-method
  1397. void **set_process_internal** **(** :ref:`bool<class_bool>` enable **)**
  1398. 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.
  1399. \ **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.
  1400. .. rst-class:: classref-item-separator
  1401. ----
  1402. .. _class_Node_method_set_process_shortcut_input:
  1403. .. rst-class:: classref-method
  1404. void **set_process_shortcut_input** **(** :ref:`bool<class_bool>` enable **)**
  1405. 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.
  1406. .. rst-class:: classref-item-separator
  1407. ----
  1408. .. _class_Node_method_set_process_unhandled_input:
  1409. .. rst-class:: classref-method
  1410. void **set_process_unhandled_input** **(** :ref:`bool<class_bool>` enable **)**
  1411. 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.
  1412. .. rst-class:: classref-item-separator
  1413. ----
  1414. .. _class_Node_method_set_process_unhandled_key_input:
  1415. .. rst-class:: classref-method
  1416. void **set_process_unhandled_key_input** **(** :ref:`bool<class_bool>` enable **)**
  1417. 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.
  1418. .. rst-class:: classref-item-separator
  1419. ----
  1420. .. _class_Node_method_set_scene_instance_load_placeholder:
  1421. .. rst-class:: classref-method
  1422. void **set_scene_instance_load_placeholder** **(** :ref:`bool<class_bool>` load_placeholder **)**
  1423. Sets whether this is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
  1424. .. rst-class:: classref-item-separator
  1425. ----
  1426. .. _class_Node_method_set_thread_safe:
  1427. .. rst-class:: classref-method
  1428. void **set_thread_safe** **(** :ref:`StringName<class_StringName>` property, :ref:`Variant<class_Variant>` value **)**
  1429. Similar to :ref:`call_thread_safe<class_Node_method_call_thread_safe>`, but for setting properties.
  1430. .. rst-class:: classref-item-separator
  1431. ----
  1432. .. _class_Node_method_update_configuration_warnings:
  1433. .. rst-class:: classref-method
  1434. void **update_configuration_warnings** **(** **)**
  1435. Updates the warning displayed for this node in the Scene Dock.
  1436. Use :ref:`_get_configuration_warnings<class_Node_method__get_configuration_warnings>` to setup the warning message to display.
  1437. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1438. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1439. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1440. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1441. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1442. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`