class_node.rst 121 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185
  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/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/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:`AnimationTreePlayer<class_AnimationTreePlayer>`, :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`, :ref:`CanvasItem<class_CanvasItem>`, :ref:`CanvasLayer<class_CanvasLayer>`, :ref:`EditorFileSystem<class_EditorFileSystem>`, :ref:`EditorInterface<class_EditorInterface>`, :ref:`EditorPlugin<class_EditorPlugin>`, :ref:`EditorResourcePreview<class_EditorResourcePreview>`, :ref:`HTTPRequest<class_HTTPRequest>`, :ref:`InstancePlaceholder<class_InstancePlaceholder>`, :ref:`NavigationAgent<class_NavigationAgent>`, :ref:`NavigationAgent2D<class_NavigationAgent2D>`, :ref:`NavigationObstacle<class_NavigationObstacle>`, :ref:`NavigationObstacle2D<class_NavigationObstacle2D>`, :ref:`ResourcePreloader<class_ResourcePreloader>`, :ref:`SkeletonIK<class_SkeletonIK>`, :ref:`Spatial<class_Spatial>`, :ref:`Timer<class_Timer>`, :ref:`Tween<class_Tween>`, :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 instanced 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 instanced 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:`NetworkedMultiplayerENet<class_NetworkedMultiplayerENet>`), 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. .. rst-class:: classref-introduction-group
  27. Tutorials
  28. ---------
  29. - :doc:`Nodes and Scenes <../getting_started/step_by_step/nodes_and_scenes>`
  30. - `All Demos <https://github.com/godotengine/godot-demo-projects/>`__
  31. .. rst-class:: classref-reftable-group
  32. Properties
  33. ----------
  34. .. table::
  35. :widths: auto
  36. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  37. | :ref:`MultiplayerAPI<class_MultiplayerAPI>` | :ref:`custom_multiplayer<class_Node_property_custom_multiplayer>` | |
  38. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  39. | :ref:`String<class_String>` | :ref:`filename<class_Node_property_filename>` | |
  40. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  41. | :ref:`MultiplayerAPI<class_MultiplayerAPI>` | :ref:`multiplayer<class_Node_property_multiplayer>` | |
  42. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  43. | :ref:`String<class_String>` | :ref:`name<class_Node_property_name>` | |
  44. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  45. | :ref:`Node<class_Node>` | :ref:`owner<class_Node_property_owner>` | |
  46. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  47. | :ref:`PauseMode<enum_Node_PauseMode>` | :ref:`pause_mode<class_Node_property_pause_mode>` | ``0`` |
  48. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  49. | :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` | :ref:`physics_interpolation_mode<class_Node_property_physics_interpolation_mode>` | ``0`` |
  50. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  51. | :ref:`int<class_int>` | :ref:`process_priority<class_Node_property_process_priority>` | ``0`` |
  52. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  53. | :ref:`bool<class_bool>` | :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>` | ``false`` |
  54. +---------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------+
  55. .. rst-class:: classref-reftable-group
  56. Methods
  57. -------
  58. .. table::
  59. :widths: auto
  60. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`_enter_tree<class_Node_method__enter_tree>` **(** **)** |virtual| |
  62. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`_exit_tree<class_Node_method__exit_tree>` **(** **)** |virtual| |
  64. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`String<class_String>` | :ref:`_get_configuration_warning<class_Node_method__get_configuration_warning>` **(** **)** |virtual| |
  66. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`_input<class_Node_method__input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  68. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`_physics_process<class_Node_method__physics_process>` **(** :ref:`float<class_float>` delta **)** |virtual| |
  70. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`_process<class_Node_method__process>` **(** :ref:`float<class_float>` delta **)** |virtual| |
  72. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`_ready<class_Node_method__ready>` **(** **)** |virtual| |
  74. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`_unhandled_input<class_Node_method__unhandled_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  76. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` **(** :ref:`InputEventKey<class_InputEventKey>` event **)** |virtual| |
  78. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`add_child<class_Node_method_add_child>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` legible_unique_name=false **)** |
  80. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`add_child_below_node<class_Node_method_add_child_below_node>` **(** :ref:`Node<class_Node>` node, :ref:`Node<class_Node>` child_node, :ref:`bool<class_bool>` legible_unique_name=false **)** |
  82. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`add_to_group<class_Node_method_add_to_group>` **(** :ref:`String<class_String>` group, :ref:`bool<class_bool>` persistent=false **)** |
  84. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`bool<class_bool>` | :ref:`can_process<class_Node_method_can_process>` **(** **)** |const| |
  86. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`SceneTreeTween<class_SceneTreeTween>` | :ref:`create_tween<class_Node_method_create_tween>` **(** **)** |
  88. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Node<class_Node>` | :ref:`duplicate<class_Node_method_duplicate>` **(** :ref:`int<class_int>` flags=15 **)** |const| |
  90. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Node<class_Node>` | :ref:`find_node<class_Node_method_find_node>` **(** :ref:`String<class_String>` mask, :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const| |
  92. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`Node<class_Node>` | :ref:`find_parent<class_Node_method_find_parent>` **(** :ref:`String<class_String>` mask **)** |const| |
  94. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`Node<class_Node>` | :ref:`get_child<class_Node_method_get_child>` **(** :ref:`int<class_int>` idx **)** |const| |
  96. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`get_child_count<class_Node_method_get_child_count>` **(** **)** |const| |
  98. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`Array<class_Array>` | :ref:`get_children<class_Node_method_get_children>` **(** **)** |const| |
  100. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`Array<class_Array>` | :ref:`get_groups<class_Node_method_get_groups>` **(** **)** |const| |
  102. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`int<class_int>` | :ref:`get_index<class_Node_method_get_index>` **(** **)** |const| |
  104. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`int<class_int>` | :ref:`get_network_master<class_Node_method_get_network_master>` **(** **)** |const| |
  106. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`Node<class_Node>` | :ref:`get_node<class_Node_method_get_node>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  108. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`Array<class_Array>` | :ref:`get_node_and_resource<class_Node_method_get_node_and_resource>` **(** :ref:`NodePath<class_NodePath>` path **)** |
  110. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`Node<class_Node>` | :ref:`get_node_or_null<class_Node_method_get_node_or_null>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  112. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`Node<class_Node>` | :ref:`get_parent<class_Node_method_get_parent>` **(** **)** |const| |
  114. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`NodePath<class_NodePath>` | :ref:`get_path<class_Node_method_get_path>` **(** **)** |const| |
  116. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`NodePath<class_NodePath>` | :ref:`get_path_to<class_Node_method_get_path_to>` **(** :ref:`Node<class_Node>` node **)** |const| |
  118. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`float<class_float>` | :ref:`get_physics_process_delta_time<class_Node_method_get_physics_process_delta_time>` **(** **)** |const| |
  120. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`int<class_int>` | :ref:`get_position_in_parent<class_Node_method_get_position_in_parent>` **(** **)** |const| |
  122. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`float<class_float>` | :ref:`get_process_delta_time<class_Node_method_get_process_delta_time>` **(** **)** |const| |
  124. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`bool<class_bool>` | :ref:`get_scene_instance_load_placeholder<class_Node_method_get_scene_instance_load_placeholder>` **(** **)** |const| |
  126. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`SceneTree<class_SceneTree>` | :ref:`get_tree<class_Node_method_get_tree>` **(** **)** |const| |
  128. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`Viewport<class_Viewport>` | :ref:`get_viewport<class_Node_method_get_viewport>` **(** **)** |const| |
  130. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`bool<class_bool>` | :ref:`has_node<class_Node_method_has_node>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  132. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`bool<class_bool>` | :ref:`has_node_and_resource<class_Node_method_has_node_and_resource>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  134. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`bool<class_bool>` | :ref:`is_a_parent_of<class_Node_method_is_a_parent_of>` **(** :ref:`Node<class_Node>` node **)** |const| |
  136. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`bool<class_bool>` | :ref:`is_displayed_folded<class_Node_method_is_displayed_folded>` **(** **)** |const| |
  138. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`bool<class_bool>` | :ref:`is_greater_than<class_Node_method_is_greater_than>` **(** :ref:`Node<class_Node>` node **)** |const| |
  140. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`bool<class_bool>` | :ref:`is_in_group<class_Node_method_is_in_group>` **(** :ref:`String<class_String>` group **)** |const| |
  142. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`bool<class_bool>` | :ref:`is_inside_tree<class_Node_method_is_inside_tree>` **(** **)** |const| |
  144. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`bool<class_bool>` | :ref:`is_network_master<class_Node_method_is_network_master>` **(** **)** |const| |
  146. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`bool<class_bool>` | :ref:`is_physics_interpolated<class_Node_method_is_physics_interpolated>` **(** **)** |const| |
  148. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`bool<class_bool>` | :ref:`is_physics_interpolated_and_enabled<class_Node_method_is_physics_interpolated_and_enabled>` **(** **)** |const| |
  150. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`bool<class_bool>` | :ref:`is_physics_processing<class_Node_method_is_physics_processing>` **(** **)** |const| |
  152. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`bool<class_bool>` | :ref:`is_physics_processing_internal<class_Node_method_is_physics_processing_internal>` **(** **)** |const| |
  154. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`bool<class_bool>` | :ref:`is_processing<class_Node_method_is_processing>` **(** **)** |const| |
  156. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`bool<class_bool>` | :ref:`is_processing_input<class_Node_method_is_processing_input>` **(** **)** |const| |
  158. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`bool<class_bool>` | :ref:`is_processing_internal<class_Node_method_is_processing_internal>` **(** **)** |const| |
  160. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`bool<class_bool>` | :ref:`is_processing_unhandled_input<class_Node_method_is_processing_unhandled_input>` **(** **)** |const| |
  162. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`bool<class_bool>` | :ref:`is_processing_unhandled_key_input<class_Node_method_is_processing_unhandled_key_input>` **(** **)** |const| |
  164. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | void | :ref:`move_child<class_Node_method_move_child>` **(** :ref:`Node<class_Node>` child_node, :ref:`int<class_int>` to_position **)** |
  166. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | void | :ref:`print_stray_nodes<class_Node_method_print_stray_nodes>` **(** **)** |
  168. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | void | :ref:`print_tree<class_Node_method_print_tree>` **(** **)** |
  170. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | void | :ref:`print_tree_pretty<class_Node_method_print_tree_pretty>` **(** **)** |
  172. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | void | :ref:`propagate_call<class_Node_method_propagate_call>` **(** :ref:`String<class_String>` method, :ref:`Array<class_Array>` args=[ ], :ref:`bool<class_bool>` parent_first=false **)** |
  174. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | void | :ref:`propagate_notification<class_Node_method_propagate_notification>` **(** :ref:`int<class_int>` what **)** |
  176. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | void | :ref:`queue_free<class_Node_method_queue_free>` **(** **)** |
  178. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | void | :ref:`raise<class_Node_method_raise>` **(** **)** |
  180. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | void | :ref:`remove_and_skip<class_Node_method_remove_and_skip>` **(** **)** |
  182. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | void | :ref:`remove_child<class_Node_method_remove_child>` **(** :ref:`Node<class_Node>` node **)** |
  184. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | void | :ref:`remove_from_group<class_Node_method_remove_from_group>` **(** :ref:`String<class_String>` group **)** |
  186. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | void | :ref:`replace_by<class_Node_method_replace_by>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` keep_data=false **)** |
  188. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | void | :ref:`request_ready<class_Node_method_request_ready>` **(** **)** |
  190. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | void | :ref:`reset_physics_interpolation<class_Node_method_reset_physics_interpolation>` **(** **)** |
  192. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | :ref:`Variant<class_Variant>` | :ref:`rpc<class_Node_method_rpc>` **(** :ref:`String<class_String>` method, ... **)** |vararg| |
  194. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | void | :ref:`rpc_config<class_Node_method_rpc_config>` **(** :ref:`String<class_String>` method, :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>` mode **)** |
  196. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | :ref:`Variant<class_Variant>` | :ref:`rpc_id<class_Node_method_rpc_id>` **(** :ref:`int<class_int>` peer_id, :ref:`String<class_String>` method, ... **)** |vararg| |
  198. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | :ref:`Variant<class_Variant>` | :ref:`rpc_unreliable<class_Node_method_rpc_unreliable>` **(** :ref:`String<class_String>` method, ... **)** |vararg| |
  200. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | :ref:`Variant<class_Variant>` | :ref:`rpc_unreliable_id<class_Node_method_rpc_unreliable_id>` **(** :ref:`int<class_int>` peer_id, :ref:`String<class_String>` method, ... **)** |vararg| |
  202. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | void | :ref:`rset<class_Node_method_rset>` **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
  204. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | void | :ref:`rset_config<class_Node_method_rset_config>` **(** :ref:`String<class_String>` property, :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>` mode **)** |
  206. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | void | :ref:`rset_id<class_Node_method_rset_id>` **(** :ref:`int<class_int>` peer_id, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
  208. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | void | :ref:`rset_unreliable<class_Node_method_rset_unreliable>` **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
  210. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | void | :ref:`rset_unreliable_id<class_Node_method_rset_unreliable_id>` **(** :ref:`int<class_int>` peer_id, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
  212. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | void | :ref:`set_display_folded<class_Node_method_set_display_folded>` **(** :ref:`bool<class_bool>` fold **)** |
  214. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | void | :ref:`set_network_master<class_Node_method_set_network_master>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` recursive=true **)** |
  216. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | void | :ref:`set_physics_process<class_Node_method_set_physics_process>` **(** :ref:`bool<class_bool>` enable **)** |
  218. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | void | :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>` **(** :ref:`bool<class_bool>` enable **)** |
  220. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | void | :ref:`set_process<class_Node_method_set_process>` **(** :ref:`bool<class_bool>` enable **)** |
  222. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. | void | :ref:`set_process_input<class_Node_method_set_process_input>` **(** :ref:`bool<class_bool>` enable **)** |
  224. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  225. | void | :ref:`set_process_internal<class_Node_method_set_process_internal>` **(** :ref:`bool<class_bool>` enable **)** |
  226. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  227. | void | :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>` **(** :ref:`bool<class_bool>` enable **)** |
  228. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  229. | void | :ref:`set_process_unhandled_key_input<class_Node_method_set_process_unhandled_key_input>` **(** :ref:`bool<class_bool>` enable **)** |
  230. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  231. | void | :ref:`set_scene_instance_load_placeholder<class_Node_method_set_scene_instance_load_placeholder>` **(** :ref:`bool<class_bool>` load_placeholder **)** |
  232. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  233. | void | :ref:`update_configuration_warning<class_Node_method_update_configuration_warning>` **(** **)** |
  234. +---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  235. .. rst-class:: classref-section-separator
  236. ----
  237. .. rst-class:: classref-descriptions-group
  238. Signals
  239. -------
  240. .. _class_Node_signal_child_entered_tree:
  241. .. rst-class:: classref-signal
  242. **child_entered_tree** **(** :ref:`Node<class_Node>` node **)**
  243. Emitted when a child node enters the scene tree, either because it entered on its own or because this node entered with it.
  244. 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>`.
  245. .. rst-class:: classref-item-separator
  246. ----
  247. .. _class_Node_signal_child_exiting_tree:
  248. .. rst-class:: classref-signal
  249. **child_exiting_tree** **(** :ref:`Node<class_Node>` node **)**
  250. 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.
  251. 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>`.
  252. .. rst-class:: classref-item-separator
  253. ----
  254. .. _class_Node_signal_ready:
  255. .. rst-class:: classref-signal
  256. **ready** **(** **)**
  257. Emitted when the node is ready.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_Node_signal_renamed:
  261. .. rst-class:: classref-signal
  262. **renamed** **(** **)**
  263. Emitted when the node is renamed.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_Node_signal_tree_entered:
  267. .. rst-class:: classref-signal
  268. **tree_entered** **(** **)**
  269. Emitted when the node enters the tree.
  270. This signal is emitted *after* the related :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification.
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_Node_signal_tree_exited:
  274. .. rst-class:: classref-signal
  275. **tree_exited** **(** **)**
  276. Emitted after the node exits the tree and is no longer active.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _class_Node_signal_tree_exiting:
  280. .. rst-class:: classref-signal
  281. **tree_exiting** **(** **)**
  282. 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).
  283. This signal is emitted *before* the related :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>` notification.
  284. .. rst-class:: classref-section-separator
  285. ----
  286. .. rst-class:: classref-descriptions-group
  287. Enumerations
  288. ------------
  289. .. _enum_Node_PauseMode:
  290. .. rst-class:: classref-enumeration
  291. enum **PauseMode**:
  292. .. _class_Node_constant_PAUSE_MODE_INHERIT:
  293. .. rst-class:: classref-enumeration-constant
  294. :ref:`PauseMode<enum_Node_PauseMode>` **PAUSE_MODE_INHERIT** = ``0``
  295. Inherits pause mode from the node's parent. For the root node, it is equivalent to :ref:`PAUSE_MODE_STOP<class_Node_constant_PAUSE_MODE_STOP>`. Default.
  296. .. _class_Node_constant_PAUSE_MODE_STOP:
  297. .. rst-class:: classref-enumeration-constant
  298. :ref:`PauseMode<enum_Node_PauseMode>` **PAUSE_MODE_STOP** = ``1``
  299. Stops processing when the :ref:`SceneTree<class_SceneTree>` is paused.
  300. .. _class_Node_constant_PAUSE_MODE_PROCESS:
  301. .. rst-class:: classref-enumeration-constant
  302. :ref:`PauseMode<enum_Node_PauseMode>` **PAUSE_MODE_PROCESS** = ``2``
  303. Continue to process regardless of the :ref:`SceneTree<class_SceneTree>` pause state.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _enum_Node_PhysicsInterpolationMode:
  307. .. rst-class:: classref-enumeration
  308. enum **PhysicsInterpolationMode**:
  309. .. _class_Node_constant_PHYSICS_INTERPOLATION_MODE_INHERIT:
  310. .. rst-class:: classref-enumeration-constant
  311. :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` **PHYSICS_INTERPOLATION_MODE_INHERIT** = ``0``
  312. Inherits physics interpolation mode from the node's parent. For the root node, it is equivalent to :ref:`PHYSICS_INTERPOLATION_MODE_ON<class_Node_constant_PHYSICS_INTERPOLATION_MODE_ON>`. Default.
  313. .. _class_Node_constant_PHYSICS_INTERPOLATION_MODE_OFF:
  314. .. rst-class:: classref-enumeration-constant
  315. :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` **PHYSICS_INTERPOLATION_MODE_OFF** = ``1``
  316. Turn off physics interpolation in this node and children set to :ref:`PHYSICS_INTERPOLATION_MODE_INHERIT<class_Node_constant_PHYSICS_INTERPOLATION_MODE_INHERIT>`.
  317. .. _class_Node_constant_PHYSICS_INTERPOLATION_MODE_ON:
  318. .. rst-class:: classref-enumeration-constant
  319. :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` **PHYSICS_INTERPOLATION_MODE_ON** = ``2``
  320. Turn on physics interpolation in this node and children set to :ref:`PHYSICS_INTERPOLATION_MODE_INHERIT<class_Node_constant_PHYSICS_INTERPOLATION_MODE_INHERIT>`.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _enum_Node_DuplicateFlags:
  324. .. rst-class:: classref-enumeration
  325. enum **DuplicateFlags**:
  326. .. _class_Node_constant_DUPLICATE_SIGNALS:
  327. .. rst-class:: classref-enumeration-constant
  328. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SIGNALS** = ``1``
  329. Duplicate the node's signals.
  330. .. _class_Node_constant_DUPLICATE_GROUPS:
  331. .. rst-class:: classref-enumeration-constant
  332. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_GROUPS** = ``2``
  333. Duplicate the node's groups.
  334. .. _class_Node_constant_DUPLICATE_SCRIPTS:
  335. .. rst-class:: classref-enumeration-constant
  336. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SCRIPTS** = ``4``
  337. Duplicate the node's scripts.
  338. .. _class_Node_constant_DUPLICATE_USE_INSTANCING:
  339. .. rst-class:: classref-enumeration-constant
  340. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_USE_INSTANCING** = ``8``
  341. Duplicate using instancing.
  342. An instance stays linked to the original so when the original changes, the instance changes too.
  343. .. rst-class:: classref-section-separator
  344. ----
  345. .. rst-class:: classref-descriptions-group
  346. Constants
  347. ---------
  348. .. _class_Node_constant_NOTIFICATION_ENTER_TREE:
  349. .. rst-class:: classref-constant
  350. **NOTIFICATION_ENTER_TREE** = ``10``
  351. Notification received when the node enters a :ref:`SceneTree<class_SceneTree>`.
  352. This notification is emitted *before* the related :ref:`tree_entered<class_Node_signal_tree_entered>`.
  353. .. _class_Node_constant_NOTIFICATION_EXIT_TREE:
  354. .. rst-class:: classref-constant
  355. **NOTIFICATION_EXIT_TREE** = ``11``
  356. Notification received when the node is about to exit a :ref:`SceneTree<class_SceneTree>`.
  357. This notification is emitted *after* the related :ref:`tree_exiting<class_Node_signal_tree_exiting>`.
  358. .. _class_Node_constant_NOTIFICATION_MOVED_IN_PARENT:
  359. .. rst-class:: classref-constant
  360. **NOTIFICATION_MOVED_IN_PARENT** = ``12``
  361. Notification received when the node is moved in the parent.
  362. .. _class_Node_constant_NOTIFICATION_READY:
  363. .. rst-class:: classref-constant
  364. **NOTIFICATION_READY** = ``13``
  365. Notification received when the node is ready. See :ref:`_ready<class_Node_method__ready>`.
  366. .. _class_Node_constant_NOTIFICATION_PAUSED:
  367. .. rst-class:: classref-constant
  368. **NOTIFICATION_PAUSED** = ``14``
  369. Notification received when the node is paused.
  370. .. _class_Node_constant_NOTIFICATION_UNPAUSED:
  371. .. rst-class:: classref-constant
  372. **NOTIFICATION_UNPAUSED** = ``15``
  373. Notification received when the node is unpaused.
  374. .. _class_Node_constant_NOTIFICATION_PHYSICS_PROCESS:
  375. .. rst-class:: classref-constant
  376. **NOTIFICATION_PHYSICS_PROCESS** = ``16``
  377. Notification received every frame when the physics process flag is set (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  378. .. _class_Node_constant_NOTIFICATION_PROCESS:
  379. .. rst-class:: classref-constant
  380. **NOTIFICATION_PROCESS** = ``17``
  381. Notification received every frame when the process flag is set (see :ref:`set_process<class_Node_method_set_process>`).
  382. .. _class_Node_constant_NOTIFICATION_PARENTED:
  383. .. rst-class:: classref-constant
  384. **NOTIFICATION_PARENTED** = ``18``
  385. Notification received when a node is set as a child of another node.
  386. \ **Note:** This doesn't mean that a node entered the :ref:`SceneTree<class_SceneTree>`.
  387. .. _class_Node_constant_NOTIFICATION_UNPARENTED:
  388. .. rst-class:: classref-constant
  389. **NOTIFICATION_UNPARENTED** = ``19``
  390. Notification received when a node is unparented (parent removed it from the list of children).
  391. .. _class_Node_constant_NOTIFICATION_INSTANCED:
  392. .. rst-class:: classref-constant
  393. **NOTIFICATION_INSTANCED** = ``20``
  394. Notification received when the node is instanced.
  395. .. _class_Node_constant_NOTIFICATION_DRAG_BEGIN:
  396. .. rst-class:: classref-constant
  397. **NOTIFICATION_DRAG_BEGIN** = ``21``
  398. Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one.
  399. 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>`.
  400. Use :ref:`Viewport.gui_get_drag_data<class_Viewport_method_gui_get_drag_data>` to get the dragged data.
  401. .. _class_Node_constant_NOTIFICATION_DRAG_END:
  402. .. rst-class:: classref-constant
  403. **NOTIFICATION_DRAG_END** = ``22``
  404. Notification received when a drag operation ends.
  405. Use :ref:`Viewport.gui_is_drag_successful<class_Viewport_method_gui_is_drag_successful>` to check if the drag succeeded.
  406. .. _class_Node_constant_NOTIFICATION_PATH_CHANGED:
  407. .. rst-class:: classref-constant
  408. **NOTIFICATION_PATH_CHANGED** = ``23``
  409. Notification received when the node's :ref:`NodePath<class_NodePath>` changed.
  410. .. _class_Node_constant_NOTIFICATION_INTERNAL_PROCESS:
  411. .. rst-class:: classref-constant
  412. **NOTIFICATION_INTERNAL_PROCESS** = ``25``
  413. Notification received every frame when the internal process flag is set (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  414. .. _class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS:
  415. .. rst-class:: classref-constant
  416. **NOTIFICATION_INTERNAL_PHYSICS_PROCESS** = ``26``
  417. 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>`).
  418. .. _class_Node_constant_NOTIFICATION_POST_ENTER_TREE:
  419. .. rst-class:: classref-constant
  420. **NOTIFICATION_POST_ENTER_TREE** = ``27``
  421. 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.
  422. .. _class_Node_constant_NOTIFICATION_RESET_PHYSICS_INTERPOLATION:
  423. .. rst-class:: classref-constant
  424. **NOTIFICATION_RESET_PHYSICS_INTERPOLATION** = ``28``
  425. Notification received when :ref:`reset_physics_interpolation<class_Node_method_reset_physics_interpolation>` is called on the node or parent nodes.
  426. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_ENTER:
  427. .. rst-class:: classref-constant
  428. **NOTIFICATION_WM_MOUSE_ENTER** = ``1002``
  429. Notification received from the OS when the mouse enters the game window.
  430. Implemented on desktop and web platforms.
  431. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_EXIT:
  432. .. rst-class:: classref-constant
  433. **NOTIFICATION_WM_MOUSE_EXIT** = ``1003``
  434. Notification received from the OS when the mouse leaves the game window.
  435. Implemented on desktop and web platforms.
  436. .. _class_Node_constant_NOTIFICATION_WM_FOCUS_IN:
  437. .. rst-class:: classref-constant
  438. **NOTIFICATION_WM_FOCUS_IN** = ``1004``
  439. Notification received from the OS when the game window is focused.
  440. Implemented on all platforms.
  441. .. _class_Node_constant_NOTIFICATION_WM_FOCUS_OUT:
  442. .. rst-class:: classref-constant
  443. **NOTIFICATION_WM_FOCUS_OUT** = ``1005``
  444. Notification received from the OS when the game window is unfocused.
  445. Implemented on all platforms.
  446. .. _class_Node_constant_NOTIFICATION_WM_QUIT_REQUEST:
  447. .. rst-class:: classref-constant
  448. **NOTIFICATION_WM_QUIT_REQUEST** = ``1006``
  449. Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4).
  450. Implemented on desktop platforms.
  451. .. _class_Node_constant_NOTIFICATION_WM_GO_BACK_REQUEST:
  452. .. rst-class:: classref-constant
  453. **NOTIFICATION_WM_GO_BACK_REQUEST** = ``1007``
  454. Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
  455. Specific to the Android platform.
  456. .. _class_Node_constant_NOTIFICATION_WM_UNFOCUS_REQUEST:
  457. .. rst-class:: classref-constant
  458. **NOTIFICATION_WM_UNFOCUS_REQUEST** = ``1008``
  459. Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus).
  460. No supported platforms currently send this notification.
  461. .. _class_Node_constant_NOTIFICATION_OS_MEMORY_WARNING:
  462. .. rst-class:: classref-constant
  463. **NOTIFICATION_OS_MEMORY_WARNING** = ``1009``
  464. Notification received from the OS when the application is exceeding its allocated memory.
  465. Specific to the iOS platform.
  466. .. _class_Node_constant_NOTIFICATION_TRANSLATION_CHANGED:
  467. .. rst-class:: classref-constant
  468. **NOTIFICATION_TRANSLATION_CHANGED** = ``1010``
  469. 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>`.
  470. .. _class_Node_constant_NOTIFICATION_WM_ABOUT:
  471. .. rst-class:: classref-constant
  472. **NOTIFICATION_WM_ABOUT** = ``1011``
  473. Notification received from the OS when a request for "About" information is sent.
  474. Specific to the macOS platform.
  475. .. _class_Node_constant_NOTIFICATION_CRASH:
  476. .. rst-class:: classref-constant
  477. **NOTIFICATION_CRASH** = ``1012``
  478. Notification received from Godot's crash handler when the engine is about to crash.
  479. Implemented on desktop platforms if the crash handler is enabled.
  480. .. _class_Node_constant_NOTIFICATION_OS_IME_UPDATE:
  481. .. rst-class:: classref-constant
  482. **NOTIFICATION_OS_IME_UPDATE** = ``1013``
  483. Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
  484. Specific to the macOS platform.
  485. .. _class_Node_constant_NOTIFICATION_APP_RESUMED:
  486. .. rst-class:: classref-constant
  487. **NOTIFICATION_APP_RESUMED** = ``1014``
  488. Notification received from the OS when the app is resumed.
  489. Specific to the Android platform.
  490. .. _class_Node_constant_NOTIFICATION_APP_PAUSED:
  491. .. rst-class:: classref-constant
  492. **NOTIFICATION_APP_PAUSED** = ``1015``
  493. Notification received from the OS when the app is paused.
  494. Specific to the Android platform.
  495. .. rst-class:: classref-section-separator
  496. ----
  497. .. rst-class:: classref-descriptions-group
  498. Property Descriptions
  499. ---------------------
  500. .. _class_Node_property_custom_multiplayer:
  501. .. rst-class:: classref-property
  502. :ref:`MultiplayerAPI<class_MultiplayerAPI>` **custom_multiplayer**
  503. .. rst-class:: classref-property-setget
  504. - void **set_custom_multiplayer** **(** :ref:`MultiplayerAPI<class_MultiplayerAPI>` value **)**
  505. - :ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_custom_multiplayer** **(** **)**
  506. The override to the default :ref:`MultiplayerAPI<class_MultiplayerAPI>`. Set to ``null`` to use the default :ref:`SceneTree<class_SceneTree>` one.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_Node_property_filename:
  510. .. rst-class:: classref-property
  511. :ref:`String<class_String>` **filename**
  512. .. rst-class:: classref-property-setget
  513. - void **set_filename** **(** :ref:`String<class_String>` value **)**
  514. - :ref:`String<class_String>` **get_filename** **(** **)**
  515. If a scene is instantiated from a file, its topmost node contains the absolute file path from which it was loaded in :ref:`filename<class_Node_property_filename>` (e.g. ``res://levels/1.tscn``). Otherwise, :ref:`filename<class_Node_property_filename>` is set to an empty string.
  516. .. rst-class:: classref-item-separator
  517. ----
  518. .. _class_Node_property_multiplayer:
  519. .. rst-class:: classref-property
  520. :ref:`MultiplayerAPI<class_MultiplayerAPI>` **multiplayer**
  521. .. rst-class:: classref-property-setget
  522. - :ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_multiplayer** **(** **)**
  523. The :ref:`MultiplayerAPI<class_MultiplayerAPI>` instance associated with this node. Either the :ref:`custom_multiplayer<class_Node_property_custom_multiplayer>`, or the default SceneTree one (if inside tree).
  524. .. rst-class:: classref-item-separator
  525. ----
  526. .. _class_Node_property_name:
  527. .. rst-class:: classref-property
  528. :ref:`String<class_String>` **name**
  529. .. rst-class:: classref-property-setget
  530. - void **set_name** **(** :ref:`String<class_String>` value **)**
  531. - :ref:`String<class_String>` **get_name** **(** **)**
  532. 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.
  533. \ **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.
  534. .. rst-class:: classref-item-separator
  535. ----
  536. .. _class_Node_property_owner:
  537. .. rst-class:: classref-property
  538. :ref:`Node<class_Node>` **owner**
  539. .. rst-class:: classref-property-setget
  540. - void **set_owner** **(** :ref:`Node<class_Node>` value **)**
  541. - :ref:`Node<class_Node>` **get_owner** **(** **)**
  542. 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.
  543. \ **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.
  544. .. rst-class:: classref-item-separator
  545. ----
  546. .. _class_Node_property_pause_mode:
  547. .. rst-class:: classref-property
  548. :ref:`PauseMode<enum_Node_PauseMode>` **pause_mode** = ``0``
  549. .. rst-class:: classref-property-setget
  550. - void **set_pause_mode** **(** :ref:`PauseMode<enum_Node_PauseMode>` value **)**
  551. - :ref:`PauseMode<enum_Node_PauseMode>` **get_pause_mode** **(** **)**
  552. Pause mode. How the node will behave if the :ref:`SceneTree<class_SceneTree>` is paused.
  553. .. rst-class:: classref-item-separator
  554. ----
  555. .. _class_Node_property_physics_interpolation_mode:
  556. .. rst-class:: classref-property
  557. :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` **physics_interpolation_mode** = ``0``
  558. .. rst-class:: classref-property-setget
  559. - void **set_physics_interpolation_mode** **(** :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` value **)**
  560. - :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` **get_physics_interpolation_mode** **(** **)**
  561. Allows enabling or disabling physics interpolation per node, offering a finer grain of control than turning physics interpolation on and off globally.
  562. \ **Note:** This can be especially useful for :ref:`Camera<class_Camera>`\ s, where custom interpolation can sometimes give superior results.
  563. .. rst-class:: classref-item-separator
  564. ----
  565. .. _class_Node_property_process_priority:
  566. .. rst-class:: classref-property
  567. :ref:`int<class_int>` **process_priority** = ``0``
  568. .. rst-class:: classref-property-setget
  569. - void **set_process_priority** **(** :ref:`int<class_int>` value **)**
  570. - :ref:`int<class_int>` **get_process_priority** **(** **)**
  571. 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.
  572. .. rst-class:: classref-item-separator
  573. ----
  574. .. _class_Node_property_unique_name_in_owner:
  575. .. rst-class:: classref-property
  576. :ref:`bool<class_bool>` **unique_name_in_owner** = ``false``
  577. .. rst-class:: classref-property-setget
  578. - void **set_unique_name_in_owner** **(** :ref:`bool<class_bool>` value **)**
  579. - :ref:`bool<class_bool>` **is_unique_name_in_owner** **(** **)**
  580. 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.
  581. 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.
  582. .. rst-class:: classref-section-separator
  583. ----
  584. .. rst-class:: classref-descriptions-group
  585. Method Descriptions
  586. -------------------
  587. .. _class_Node_method__enter_tree:
  588. .. rst-class:: classref-method
  589. void **_enter_tree** **(** **)** |virtual|
  590. 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.
  591. Corresponds to the :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  592. .. rst-class:: classref-item-separator
  593. ----
  594. .. _class_Node_method__exit_tree:
  595. .. rst-class:: classref-method
  596. void **_exit_tree** **(** **)** |virtual|
  597. 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.
  598. 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>`.
  599. .. rst-class:: classref-item-separator
  600. ----
  601. .. _class_Node_method__get_configuration_warning:
  602. .. rst-class:: classref-method
  603. :ref:`String<class_String>` **_get_configuration_warning** **(** **)** |virtual|
  604. The string returned from this method is displayed as a warning in the Scene Dock if the script that overrides it is a ``tool`` script.
  605. Returning an empty string produces no warning.
  606. Call :ref:`update_configuration_warning<class_Node_method_update_configuration_warning>` when the warning needs to be updated for this node.
  607. .. rst-class:: classref-item-separator
  608. ----
  609. .. _class_Node_method__input:
  610. .. rst-class:: classref-method
  611. void **_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  612. Called when there is an input event. The input event propagates up through the node tree until a node consumes it.
  613. 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>`.
  614. To consume the input event and stop it propagating further to other nodes, :ref:`SceneTree.set_input_as_handled<class_SceneTree_method_set_input_as_handled>` can be called.
  615. 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.
  616. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  617. .. rst-class:: classref-item-separator
  618. ----
  619. .. _class_Node_method__physics_process:
  620. .. rst-class:: classref-method
  621. void **_physics_process** **(** :ref:`float<class_float>` delta **)** |virtual|
  622. 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.
  623. 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>`.
  624. Corresponds to the :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  625. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  626. .. rst-class:: classref-item-separator
  627. ----
  628. .. _class_Node_method__process:
  629. .. rst-class:: classref-method
  630. void **_process** **(** :ref:`float<class_float>` delta **)** |virtual|
  631. 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.
  632. 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>`.
  633. Corresponds to the :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  634. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  635. .. rst-class:: classref-item-separator
  636. ----
  637. .. _class_Node_method__ready:
  638. .. rst-class:: classref-method
  639. void **_ready** **(** **)** |virtual|
  640. 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.
  641. Corresponds to the :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` notification in :ref:`Object._notification<class_Object_method__notification>`. See also the ``onready`` keyword for variables.
  642. 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>`.
  643. \ **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.
  644. .. rst-class:: classref-item-separator
  645. ----
  646. .. _class_Node_method__unhandled_input:
  647. .. rst-class:: classref-method
  648. void **_unhandled_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  649. 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.
  650. 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>`.
  651. To consume the input event and stop it propagating further to other nodes, :ref:`SceneTree.set_input_as_handled<class_SceneTree_method_set_input_as_handled>` can be called.
  652. 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.
  653. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  654. .. rst-class:: classref-item-separator
  655. ----
  656. .. _class_Node_method__unhandled_key_input:
  657. .. rst-class:: classref-method
  658. void **_unhandled_key_input** **(** :ref:`InputEventKey<class_InputEventKey>` event **)** |virtual|
  659. 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.
  660. 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>`.
  661. To consume the input event and stop it propagating further to other nodes, :ref:`SceneTree.set_input_as_handled<class_SceneTree_method_set_input_as_handled>` can be called.
  662. 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.
  663. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  664. .. rst-class:: classref-item-separator
  665. ----
  666. .. _class_Node_method_add_child:
  667. .. rst-class:: classref-method
  668. void **add_child** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` legible_unique_name=false **)**
  669. 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.
  670. If ``legible_unique_name`` is ``true``, the child node will have a human-readable name based on the name of the node being instanced instead of its type.
  671. \ **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:
  672. ::
  673. if child_node.get_parent():
  674. child_node.get_parent().remove_child(child_node)
  675. add_child(child_node)
  676. \ **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.
  677. .. rst-class:: classref-item-separator
  678. ----
  679. .. _class_Node_method_add_child_below_node:
  680. .. rst-class:: classref-method
  681. void **add_child_below_node** **(** :ref:`Node<class_Node>` node, :ref:`Node<class_Node>` child_node, :ref:`bool<class_bool>` legible_unique_name=false **)**
  682. Adds ``child_node`` as a child. The child is placed below the given ``node`` in the list of children.
  683. If ``legible_unique_name`` is ``true``, the child node will have a human-readable name based on the name of the node being instanced instead of its type.
  684. .. rst-class:: classref-item-separator
  685. ----
  686. .. _class_Node_method_add_to_group:
  687. .. rst-class:: classref-method
  688. void **add_to_group** **(** :ref:`String<class_String>` group, :ref:`bool<class_bool>` persistent=false **)**
  689. 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>`.
  690. The ``persistent`` option is used when packing node to :ref:`PackedScene<class_PackedScene>` and saving to file. Non-persistent groups aren't stored.
  691. \ **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.
  692. .. rst-class:: classref-item-separator
  693. ----
  694. .. _class_Node_method_can_process:
  695. .. rst-class:: classref-method
  696. :ref:`bool<class_bool>` **can_process** **(** **)** |const|
  697. Returns ``true`` if the node can process while the scene tree is paused (see :ref:`pause_mode<class_Node_property_pause_mode>`). Always returns ``true`` if the scene tree is not paused, and ``false`` if the node is not in the tree.
  698. .. rst-class:: classref-item-separator
  699. ----
  700. .. _class_Node_method_create_tween:
  701. .. rst-class:: classref-method
  702. :ref:`SceneTreeTween<class_SceneTreeTween>` **create_tween** **(** **)**
  703. Creates a new :ref:`SceneTreeTween<class_SceneTreeTween>` and binds it to this node. This is equivalent of doing:
  704. ::
  705. get_tree().create_tween().bind_node(self)
  706. .. rst-class:: classref-item-separator
  707. ----
  708. .. _class_Node_method_duplicate:
  709. .. rst-class:: classref-method
  710. :ref:`Node<class_Node>` **duplicate** **(** :ref:`int<class_int>` flags=15 **)** |const|
  711. Duplicates the node, returning a new node.
  712. You can fine-tune the behavior using the ``flags`` (see :ref:`DuplicateFlags<enum_Node_DuplicateFlags>`).
  713. \ **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.
  714. .. rst-class:: classref-item-separator
  715. ----
  716. .. _class_Node_method_find_node:
  717. .. rst-class:: classref-method
  718. :ref:`Node<class_Node>` **find_node** **(** :ref:`String<class_String>` mask, :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const|
  719. Finds a descendant of this node whose name matches ``mask`` as in :ref:`String.match<class_String_method_match>` (i.e. case-sensitive, but ``"*"`` matches zero or more characters and ``"?"`` matches any single character except ``"."``). Returns ``null`` if no matching **Node** is found.
  720. \ **Note:** It does not match against the full path, just against individual node names.
  721. If ``owned`` is ``true``, this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
  722. \ **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>` instead. To avoid using :ref:`find_node<class_Node_method_find_node>` too often, consider caching the node reference into a variable.
  723. .. rst-class:: classref-item-separator
  724. ----
  725. .. _class_Node_method_find_parent:
  726. .. rst-class:: classref-method
  727. :ref:`Node<class_Node>` **find_parent** **(** :ref:`String<class_String>` mask **)** |const|
  728. Finds the first parent of the current node whose name matches ``mask`` as in :ref:`String.match<class_String_method_match>` (i.e. case-sensitive, but ``"*"`` matches zero or more characters and ``"?"`` matches any single character except ``"."``).
  729. \ **Note:** It does not match against the full path, just against individual node names.
  730. \ **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>` instead. To avoid using :ref:`find_parent<class_Node_method_find_parent>` too often, consider caching the node reference into a variable.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _class_Node_method_get_child:
  734. .. rst-class:: classref-method
  735. :ref:`Node<class_Node>` **get_child** **(** :ref:`int<class_int>` idx **)** |const|
  736. 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.
  737. To access a child node via its name, use :ref:`get_node<class_Node_method_get_node>`.
  738. .. rst-class:: classref-item-separator
  739. ----
  740. .. _class_Node_method_get_child_count:
  741. .. rst-class:: classref-method
  742. :ref:`int<class_int>` **get_child_count** **(** **)** |const|
  743. Returns the number of child nodes.
  744. .. rst-class:: classref-item-separator
  745. ----
  746. .. _class_Node_method_get_children:
  747. .. rst-class:: classref-method
  748. :ref:`Array<class_Array>` **get_children** **(** **)** |const|
  749. Returns an array of references to node's children.
  750. .. rst-class:: classref-item-separator
  751. ----
  752. .. _class_Node_method_get_groups:
  753. .. rst-class:: classref-method
  754. :ref:`Array<class_Array>` **get_groups** **(** **)** |const|
  755. Returns an array listing the groups that the node is a member of.
  756. \ **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.
  757. \ **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:
  758. ::
  759. # Stores the node's non-internal groups only (as an array of Strings).
  760. var non_internal_groups = []
  761. for group in get_groups():
  762. if not group.begins_with("_"):
  763. non_internal_groups.push_back(group)
  764. .. rst-class:: classref-item-separator
  765. ----
  766. .. _class_Node_method_get_index:
  767. .. rst-class:: classref-method
  768. :ref:`int<class_int>` **get_index** **(** **)** |const|
  769. Returns the node's index, i.e. its position among the siblings of its parent.
  770. .. rst-class:: classref-item-separator
  771. ----
  772. .. _class_Node_method_get_network_master:
  773. .. rst-class:: classref-method
  774. :ref:`int<class_int>` **get_network_master** **(** **)** |const|
  775. Returns the peer ID of the network master for this node. See :ref:`set_network_master<class_Node_method_set_network_master>`.
  776. .. rst-class:: classref-item-separator
  777. ----
  778. .. _class_Node_method_get_node:
  779. .. rst-class:: classref-method
  780. :ref:`Node<class_Node>` **get_node** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  781. 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.
  782. \ **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>`).
  783. \ **Example:** Assume your current node is Character and the following tree:
  784. ::
  785. /root
  786. /root/Character
  787. /root/Character/Sword
  788. /root/Character/Backpack/Dagger
  789. /root/MyGame
  790. /root/Swamp/Alligator
  791. /root/Swamp/Mosquito
  792. /root/Swamp/Goblin
  793. Possible paths are:
  794. ::
  795. get_node("Sword")
  796. get_node("Backpack/Dagger")
  797. get_node("../Swamp/Alligator")
  798. get_node("/root/MyGame")
  799. .. rst-class:: classref-item-separator
  800. ----
  801. .. _class_Node_method_get_node_and_resource:
  802. .. rst-class:: classref-method
  803. :ref:`Array<class_Array>` **get_node_and_resource** **(** :ref:`NodePath<class_NodePath>` path **)**
  804. 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.
  805. 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.
  806. 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:
  807. ::
  808. print(get_node_and_resource("Area2D/CollisionShape2D")) # [[CollisionShape2D:1161], Null, ]
  809. print(get_node_and_resource("Area2D/CollisionShape2D:shape")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
  810. print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
  811. .. rst-class:: classref-item-separator
  812. ----
  813. .. _class_Node_method_get_node_or_null:
  814. .. rst-class:: classref-method
  815. :ref:`Node<class_Node>` **get_node_or_null** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  816. 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**.
  817. .. rst-class:: classref-item-separator
  818. ----
  819. .. _class_Node_method_get_parent:
  820. .. rst-class:: classref-method
  821. :ref:`Node<class_Node>` **get_parent** **(** **)** |const|
  822. Returns the parent node of the current node, or ``null`` if the node lacks a parent.
  823. .. rst-class:: classref-item-separator
  824. ----
  825. .. _class_Node_method_get_path:
  826. .. rst-class:: classref-method
  827. :ref:`NodePath<class_NodePath>` **get_path** **(** **)** |const|
  828. 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>`).
  829. .. rst-class:: classref-item-separator
  830. ----
  831. .. _class_Node_method_get_path_to:
  832. .. rst-class:: classref-method
  833. :ref:`NodePath<class_NodePath>` **get_path_to** **(** :ref:`Node<class_Node>` node **)** |const|
  834. 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.
  835. .. rst-class:: classref-item-separator
  836. ----
  837. .. _class_Node_method_get_physics_process_delta_time:
  838. .. rst-class:: classref-method
  839. :ref:`float<class_float>` **get_physics_process_delta_time** **(** **)** |const|
  840. 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.iterations_per_second<class_Engine_property_iterations_per_second>`.
  841. .. rst-class:: classref-item-separator
  842. ----
  843. .. _class_Node_method_get_position_in_parent:
  844. .. rst-class:: classref-method
  845. :ref:`int<class_int>` **get_position_in_parent** **(** **)** |const|
  846. Returns the node's order in the scene tree branch. For example, if called on the first child node the position is ``0``.
  847. .. rst-class:: classref-item-separator
  848. ----
  849. .. _class_Node_method_get_process_delta_time:
  850. .. rst-class:: classref-method
  851. :ref:`float<class_float>` **get_process_delta_time** **(** **)** |const|
  852. Returns the time elapsed (in seconds) since the last process callback. This value may vary from frame to frame.
  853. .. rst-class:: classref-item-separator
  854. ----
  855. .. _class_Node_method_get_scene_instance_load_placeholder:
  856. .. rst-class:: classref-method
  857. :ref:`bool<class_bool>` **get_scene_instance_load_placeholder** **(** **)** |const|
  858. Returns ``true`` if this is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
  859. .. rst-class:: classref-item-separator
  860. ----
  861. .. _class_Node_method_get_tree:
  862. .. rst-class:: classref-method
  863. :ref:`SceneTree<class_SceneTree>` **get_tree** **(** **)** |const|
  864. Returns the :ref:`SceneTree<class_SceneTree>` that contains this node.
  865. .. rst-class:: classref-item-separator
  866. ----
  867. .. _class_Node_method_get_viewport:
  868. .. rst-class:: classref-method
  869. :ref:`Viewport<class_Viewport>` **get_viewport** **(** **)** |const|
  870. Returns the node's :ref:`Viewport<class_Viewport>`.
  871. .. rst-class:: classref-item-separator
  872. ----
  873. .. _class_Node_method_has_node:
  874. .. rst-class:: classref-method
  875. :ref:`bool<class_bool>` **has_node** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  876. Returns ``true`` if the node that the :ref:`NodePath<class_NodePath>` points to exists.
  877. .. rst-class:: classref-item-separator
  878. ----
  879. .. _class_Node_method_has_node_and_resource:
  880. .. rst-class:: classref-method
  881. :ref:`bool<class_bool>` **has_node_and_resource** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  882. 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.
  883. .. rst-class:: classref-item-separator
  884. ----
  885. .. _class_Node_method_is_a_parent_of:
  886. .. rst-class:: classref-method
  887. :ref:`bool<class_bool>` **is_a_parent_of** **(** :ref:`Node<class_Node>` node **)** |const|
  888. Returns ``true`` if the given node is a direct or indirect child of the current node.
  889. .. rst-class:: classref-item-separator
  890. ----
  891. .. _class_Node_method_is_displayed_folded:
  892. .. rst-class:: classref-method
  893. :ref:`bool<class_bool>` **is_displayed_folded** **(** **)** |const|
  894. Returns ``true`` if the node is folded (collapsed) in the Scene dock.
  895. .. rst-class:: classref-item-separator
  896. ----
  897. .. _class_Node_method_is_greater_than:
  898. .. rst-class:: classref-method
  899. :ref:`bool<class_bool>` **is_greater_than** **(** :ref:`Node<class_Node>` node **)** |const|
  900. Returns ``true`` if the given node occurs later in the scene hierarchy than the current node.
  901. .. rst-class:: classref-item-separator
  902. ----
  903. .. _class_Node_method_is_in_group:
  904. .. rst-class:: classref-method
  905. :ref:`bool<class_bool>` **is_in_group** **(** :ref:`String<class_String>` group **)** |const|
  906. Returns ``true`` if this node is in the specified group. See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  907. .. rst-class:: classref-item-separator
  908. ----
  909. .. _class_Node_method_is_inside_tree:
  910. .. rst-class:: classref-method
  911. :ref:`bool<class_bool>` **is_inside_tree** **(** **)** |const|
  912. Returns ``true`` if this node is currently inside a :ref:`SceneTree<class_SceneTree>`.
  913. .. rst-class:: classref-item-separator
  914. ----
  915. .. _class_Node_method_is_network_master:
  916. .. rst-class:: classref-method
  917. :ref:`bool<class_bool>` **is_network_master** **(** **)** |const|
  918. Returns ``true`` if the local system is the master of this node.
  919. .. rst-class:: classref-item-separator
  920. ----
  921. .. _class_Node_method_is_physics_interpolated:
  922. .. rst-class:: classref-method
  923. :ref:`bool<class_bool>` **is_physics_interpolated** **(** **)** |const|
  924. Returns ``true`` if the physics interpolated flag is set for this Node (see :ref:`physics_interpolation_mode<class_Node_property_physics_interpolation_mode>`).
  925. \ **Note:** Interpolation will only be active if both the flag is set **and** physics interpolation is enabled within the :ref:`SceneTree<class_SceneTree>`. This can be tested using :ref:`is_physics_interpolated_and_enabled<class_Node_method_is_physics_interpolated_and_enabled>`.
  926. .. rst-class:: classref-item-separator
  927. ----
  928. .. _class_Node_method_is_physics_interpolated_and_enabled:
  929. .. rst-class:: classref-method
  930. :ref:`bool<class_bool>` **is_physics_interpolated_and_enabled** **(** **)** |const|
  931. Returns ``true`` if physics interpolation is enabled (see :ref:`physics_interpolation_mode<class_Node_property_physics_interpolation_mode>`) **and** enabled in the :ref:`SceneTree<class_SceneTree>`.
  932. This is a convenience version of :ref:`is_physics_interpolated<class_Node_method_is_physics_interpolated>` that also checks whether physics interpolation is enabled globally.
  933. See :ref:`SceneTree.physics_interpolation<class_SceneTree_property_physics_interpolation>` and :ref:`ProjectSettings.physics/common/physics_interpolation<class_ProjectSettings_property_physics/common/physics_interpolation>`.
  934. .. rst-class:: classref-item-separator
  935. ----
  936. .. _class_Node_method_is_physics_processing:
  937. .. rst-class:: classref-method
  938. :ref:`bool<class_bool>` **is_physics_processing** **(** **)** |const|
  939. Returns ``true`` if physics processing is enabled (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  940. .. rst-class:: classref-item-separator
  941. ----
  942. .. _class_Node_method_is_physics_processing_internal:
  943. .. rst-class:: classref-method
  944. :ref:`bool<class_bool>` **is_physics_processing_internal** **(** **)** |const|
  945. Returns ``true`` if internal physics processing is enabled (see :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>`).
  946. .. rst-class:: classref-item-separator
  947. ----
  948. .. _class_Node_method_is_processing:
  949. .. rst-class:: classref-method
  950. :ref:`bool<class_bool>` **is_processing** **(** **)** |const|
  951. Returns ``true`` if processing is enabled (see :ref:`set_process<class_Node_method_set_process>`).
  952. .. rst-class:: classref-item-separator
  953. ----
  954. .. _class_Node_method_is_processing_input:
  955. .. rst-class:: classref-method
  956. :ref:`bool<class_bool>` **is_processing_input** **(** **)** |const|
  957. Returns ``true`` if the node is processing input (see :ref:`set_process_input<class_Node_method_set_process_input>`).
  958. .. rst-class:: classref-item-separator
  959. ----
  960. .. _class_Node_method_is_processing_internal:
  961. .. rst-class:: classref-method
  962. :ref:`bool<class_bool>` **is_processing_internal** **(** **)** |const|
  963. Returns ``true`` if internal processing is enabled (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  964. .. rst-class:: classref-item-separator
  965. ----
  966. .. _class_Node_method_is_processing_unhandled_input:
  967. .. rst-class:: classref-method
  968. :ref:`bool<class_bool>` **is_processing_unhandled_input** **(** **)** |const|
  969. Returns ``true`` if the node is processing unhandled input (see :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>`).
  970. .. rst-class:: classref-item-separator
  971. ----
  972. .. _class_Node_method_is_processing_unhandled_key_input:
  973. .. rst-class:: classref-method
  974. :ref:`bool<class_bool>` **is_processing_unhandled_key_input** **(** **)** |const|
  975. 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>`).
  976. .. rst-class:: classref-item-separator
  977. ----
  978. .. _class_Node_method_move_child:
  979. .. rst-class:: classref-method
  980. void **move_child** **(** :ref:`Node<class_Node>` child_node, :ref:`int<class_int>` to_position **)**
  981. Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful.
  982. .. rst-class:: classref-item-separator
  983. ----
  984. .. _class_Node_method_print_stray_nodes:
  985. .. rst-class:: classref-method
  986. void **print_stray_nodes** **(** **)**
  987. Prints all stray nodes (nodes outside the :ref:`SceneTree<class_SceneTree>`). Used for debugging. Works only in debug builds.
  988. .. rst-class:: classref-item-separator
  989. ----
  990. .. _class_Node_method_print_tree:
  991. .. rst-class:: classref-method
  992. void **print_tree** **(** **)**
  993. 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.
  994. \ **Example output:**\
  995. ::
  996. TheGame
  997. TheGame/Menu
  998. TheGame/Menu/Label
  999. TheGame/Menu/Camera2D
  1000. TheGame/SplashScreen
  1001. TheGame/SplashScreen/Camera2D
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_Node_method_print_tree_pretty:
  1005. .. rst-class:: classref-method
  1006. void **print_tree_pretty** **(** **)**
  1007. 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 inspector. It is useful for inspecting larger trees.
  1008. \ **Example output:**\
  1009. ::
  1010. ┖╴TheGame
  1011. ┠╴Menu
  1012. ┃ ┠╴Label
  1013. ┃ ┖╴Camera2D
  1014. ┖╴SplashScreen
  1015. ┖╴Camera2D
  1016. .. rst-class:: classref-item-separator
  1017. ----
  1018. .. _class_Node_method_propagate_call:
  1019. .. rst-class:: classref-method
  1020. void **propagate_call** **(** :ref:`String<class_String>` method, :ref:`Array<class_Array>` args=[ ], :ref:`bool<class_bool>` parent_first=false **)**
  1021. 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.
  1022. .. rst-class:: classref-item-separator
  1023. ----
  1024. .. _class_Node_method_propagate_notification:
  1025. .. rst-class:: classref-method
  1026. void **propagate_notification** **(** :ref:`int<class_int>` what **)**
  1027. Notifies the current node and all its children recursively by calling :ref:`Object.notification<class_Object_method_notification>` on all of them.
  1028. .. rst-class:: classref-item-separator
  1029. ----
  1030. .. _class_Node_method_queue_free:
  1031. .. rst-class:: classref-method
  1032. void **queue_free** **(** **)**
  1033. 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.
  1034. \ **Important:** If you have a variable pointing to a node, it will *not* be assigned to ``null`` once the node is freed. Instead, it will point to a *previously freed instance* and you should validate it with :ref:`@GDScript.is_instance_valid<class_@GDScript_method_is_instance_valid>` before attempting to call its methods or access its properties.
  1035. .. rst-class:: classref-item-separator
  1036. ----
  1037. .. _class_Node_method_raise:
  1038. .. rst-class:: classref-method
  1039. void **raise** **(** **)**
  1040. Moves this node to the bottom of parent node's children hierarchy. This is often useful in GUIs (:ref:`Control<class_Control>` nodes), because their order of drawing depends on their order in the tree. The top Node is drawn first, then any siblings below the top Node in the hierarchy are successively drawn on top of it. After using ``raise``, a Control will be drawn on top of its siblings.
  1041. .. rst-class:: classref-item-separator
  1042. ----
  1043. .. _class_Node_method_remove_and_skip:
  1044. .. rst-class:: classref-method
  1045. void **remove_and_skip** **(** **)**
  1046. Removes a node and sets all its children as children of the parent node (if it exists). All event subscriptions that pass by the removed node will be unsubscribed.
  1047. .. rst-class:: classref-item-separator
  1048. ----
  1049. .. _class_Node_method_remove_child:
  1050. .. rst-class:: classref-method
  1051. void **remove_child** **(** :ref:`Node<class_Node>` node **)**
  1052. Removes a child node. The node is NOT deleted and must be deleted manually.
  1053. \ **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.
  1054. .. rst-class:: classref-item-separator
  1055. ----
  1056. .. _class_Node_method_remove_from_group:
  1057. .. rst-class:: classref-method
  1058. void **remove_from_group** **(** :ref:`String<class_String>` group **)**
  1059. Removes a node from a group. See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  1060. .. rst-class:: classref-item-separator
  1061. ----
  1062. .. _class_Node_method_replace_by:
  1063. .. rst-class:: classref-method
  1064. void **replace_by** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` keep_data=false **)**
  1065. Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost.
  1066. \ **Note:** The given node will become the new parent of any child nodes that the replaced node had.
  1067. \ **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>`.
  1068. .. rst-class:: classref-item-separator
  1069. ----
  1070. .. _class_Node_method_request_ready:
  1071. .. rst-class:: classref-method
  1072. void **request_ready** **(** **)**
  1073. 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).
  1074. .. rst-class:: classref-item-separator
  1075. ----
  1076. .. _class_Node_method_reset_physics_interpolation:
  1077. .. rst-class:: classref-method
  1078. void **reset_physics_interpolation** **(** **)**
  1079. When physics interpolation is active, moving a node to a radically different transform (such as placement within a level) can result in a visible glitch as the object is rendered moving from the old to new position over the physics tick.
  1080. This glitch can be prevented by calling ``reset_physics_interpolation``, which temporarily turns off interpolation until the physics tick is complete.
  1081. \ :ref:`NOTIFICATION_RESET_PHYSICS_INTERPOLATION<class_Node_constant_NOTIFICATION_RESET_PHYSICS_INTERPOLATION>` will be received by the node and all children recursively.
  1082. \ **Note:** This function should be called **after** moving the node, rather than before.
  1083. .. rst-class:: classref-item-separator
  1084. ----
  1085. .. _class_Node_method_rpc:
  1086. .. rst-class:: classref-method
  1087. :ref:`Variant<class_Variant>` **rpc** **(** :ref:`String<class_String>` method, ... **)** |vararg|
  1088. 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. Behaviour depends on the RPC configuration for the given method, see :ref:`rpc_config<class_Node_method_rpc_config>`. Methods are not exposed to RPCs by default. See also :ref:`rset<class_Node_method_rset>` and :ref:`rset_config<class_Node_method_rset_config>` for properties. Returns ``null``.
  1089. \ **Note:** You can only safely use RPCs on clients after you received the ``connected_to_server`` signal from the :ref:`SceneTree<class_SceneTree>`. You also need to keep track of the connection state, either by the :ref:`SceneTree<class_SceneTree>` signals like ``server_disconnected`` or by checking ``SceneTree.network_peer.get_connection_status() == CONNECTION_CONNECTED``.
  1090. .. rst-class:: classref-item-separator
  1091. ----
  1092. .. _class_Node_method_rpc_config:
  1093. .. rst-class:: classref-method
  1094. void **rpc_config** **(** :ref:`String<class_String>` method, :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>` mode **)**
  1095. Changes the RPC mode for the given ``method`` to the given ``mode``. See :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>`. An alternative is annotating methods and properties with the corresponding keywords (``remote``, ``master``, ``puppet``, ``remotesync``, ``mastersync``, ``puppetsync``). By default, methods are not exposed to networking (and RPCs). See also :ref:`rset<class_Node_method_rset>` and :ref:`rset_config<class_Node_method_rset_config>` for properties.
  1096. .. rst-class:: classref-item-separator
  1097. ----
  1098. .. _class_Node_method_rpc_id:
  1099. .. rst-class:: classref-method
  1100. :ref:`Variant<class_Variant>` **rpc_id** **(** :ref:`int<class_int>` peer_id, :ref:`String<class_String>` method, ... **)** |vararg|
  1101. Sends a :ref:`rpc<class_Node_method_rpc>` to a specific peer identified by ``peer_id`` (see :ref:`NetworkedMultiplayerPeer.set_target_peer<class_NetworkedMultiplayerPeer_method_set_target_peer>`). Returns ``null``.
  1102. .. rst-class:: classref-item-separator
  1103. ----
  1104. .. _class_Node_method_rpc_unreliable:
  1105. .. rst-class:: classref-method
  1106. :ref:`Variant<class_Variant>` **rpc_unreliable** **(** :ref:`String<class_String>` method, ... **)** |vararg|
  1107. Sends a :ref:`rpc<class_Node_method_rpc>` using an unreliable protocol. Returns ``null``.
  1108. .. rst-class:: classref-item-separator
  1109. ----
  1110. .. _class_Node_method_rpc_unreliable_id:
  1111. .. rst-class:: classref-method
  1112. :ref:`Variant<class_Variant>` **rpc_unreliable_id** **(** :ref:`int<class_int>` peer_id, :ref:`String<class_String>` method, ... **)** |vararg|
  1113. Sends a :ref:`rpc<class_Node_method_rpc>` to a specific peer identified by ``peer_id`` using an unreliable protocol (see :ref:`NetworkedMultiplayerPeer.set_target_peer<class_NetworkedMultiplayerPeer_method_set_target_peer>`). Returns ``null``.
  1114. .. rst-class:: classref-item-separator
  1115. ----
  1116. .. _class_Node_method_rset:
  1117. .. rst-class:: classref-method
  1118. void **rset** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
  1119. Remotely changes a property's value on other peers (and locally). Behaviour depends on the RPC configuration for the given property, see :ref:`rset_config<class_Node_method_rset_config>`. See also :ref:`rpc<class_Node_method_rpc>` for RPCs for methods, most information applies to this method as well.
  1120. .. rst-class:: classref-item-separator
  1121. ----
  1122. .. _class_Node_method_rset_config:
  1123. .. rst-class:: classref-method
  1124. void **rset_config** **(** :ref:`String<class_String>` property, :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>` mode **)**
  1125. Changes the RPC mode for the given ``property`` to the given ``mode``. See :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>`. An alternative is annotating methods and properties with the corresponding keywords (``remote``, ``master``, ``puppet``, ``remotesync``, ``mastersync``, ``puppetsync``). By default, properties are not exposed to networking (and RPCs). See also :ref:`rpc<class_Node_method_rpc>` and :ref:`rpc_config<class_Node_method_rpc_config>` for methods.
  1126. .. rst-class:: classref-item-separator
  1127. ----
  1128. .. _class_Node_method_rset_id:
  1129. .. rst-class:: classref-method
  1130. void **rset_id** **(** :ref:`int<class_int>` peer_id, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
  1131. Remotely changes the property's value on a specific peer identified by ``peer_id`` (see :ref:`NetworkedMultiplayerPeer.set_target_peer<class_NetworkedMultiplayerPeer_method_set_target_peer>`).
  1132. .. rst-class:: classref-item-separator
  1133. ----
  1134. .. _class_Node_method_rset_unreliable:
  1135. .. rst-class:: classref-method
  1136. void **rset_unreliable** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
  1137. Remotely changes the property's value on other peers (and locally) using an unreliable protocol.
  1138. .. rst-class:: classref-item-separator
  1139. ----
  1140. .. _class_Node_method_rset_unreliable_id:
  1141. .. rst-class:: classref-method
  1142. void **rset_unreliable_id** **(** :ref:`int<class_int>` peer_id, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
  1143. Remotely changes property's value on a specific peer identified by ``peer_id`` using an unreliable protocol (see :ref:`NetworkedMultiplayerPeer.set_target_peer<class_NetworkedMultiplayerPeer_method_set_target_peer>`).
  1144. .. rst-class:: classref-item-separator
  1145. ----
  1146. .. _class_Node_method_set_display_folded:
  1147. .. rst-class:: classref-method
  1148. void **set_display_folded** **(** :ref:`bool<class_bool>` fold **)**
  1149. Sets the folded state of the node in the Scene dock.
  1150. .. rst-class:: classref-item-separator
  1151. ----
  1152. .. _class_Node_method_set_network_master:
  1153. .. rst-class:: classref-method
  1154. void **set_network_master** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` recursive=true **)**
  1155. Sets the node's network master to the peer with the given peer ID. The network master is the peer that has authority over the node on the network. Useful in conjunction with the ``master`` and ``puppet`` keywords. 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 master for all children of this node.
  1156. .. rst-class:: classref-item-separator
  1157. ----
  1158. .. _class_Node_method_set_physics_process:
  1159. .. rst-class:: classref-method
  1160. void **set_physics_process** **(** :ref:`bool<class_bool>` enable **)**
  1161. 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.iterations_per_second<class_Engine_property_iterations_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.
  1162. .. rst-class:: classref-item-separator
  1163. ----
  1164. .. _class_Node_method_set_physics_process_internal:
  1165. .. rst-class:: classref-method
  1166. void **set_physics_process_internal** **(** :ref:`bool<class_bool>` enable **)**
  1167. 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.
  1168. \ **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.
  1169. .. rst-class:: classref-item-separator
  1170. ----
  1171. .. _class_Node_method_set_process:
  1172. .. rst-class:: classref-method
  1173. void **set_process** **(** :ref:`bool<class_bool>` enable **)**
  1174. 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.
  1175. .. rst-class:: classref-item-separator
  1176. ----
  1177. .. _class_Node_method_set_process_input:
  1178. .. rst-class:: classref-method
  1179. void **set_process_input** **(** :ref:`bool<class_bool>` enable **)**
  1180. 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.
  1181. .. rst-class:: classref-item-separator
  1182. ----
  1183. .. _class_Node_method_set_process_internal:
  1184. .. rst-class:: classref-method
  1185. void **set_process_internal** **(** :ref:`bool<class_bool>` enable **)**
  1186. 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.
  1187. \ **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.
  1188. .. rst-class:: classref-item-separator
  1189. ----
  1190. .. _class_Node_method_set_process_unhandled_input:
  1191. .. rst-class:: classref-method
  1192. void **set_process_unhandled_input** **(** :ref:`bool<class_bool>` enable **)**
  1193. 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.
  1194. .. rst-class:: classref-item-separator
  1195. ----
  1196. .. _class_Node_method_set_process_unhandled_key_input:
  1197. .. rst-class:: classref-method
  1198. void **set_process_unhandled_key_input** **(** :ref:`bool<class_bool>` enable **)**
  1199. 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.
  1200. .. rst-class:: classref-item-separator
  1201. ----
  1202. .. _class_Node_method_set_scene_instance_load_placeholder:
  1203. .. rst-class:: classref-method
  1204. void **set_scene_instance_load_placeholder** **(** :ref:`bool<class_bool>` load_placeholder **)**
  1205. Sets whether this is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
  1206. .. rst-class:: classref-item-separator
  1207. ----
  1208. .. _class_Node_method_update_configuration_warning:
  1209. .. rst-class:: classref-method
  1210. void **update_configuration_warning** **(** **)**
  1211. Updates the warning displayed for this node in the Scene Dock.
  1212. Use :ref:`_get_configuration_warning<class_Node_method__get_configuration_warning>` to setup the warning message to display.
  1213. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1214. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1215. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1216. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`