As one of the most important classes, the godot.SceneTree manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded.

You can also use the godot.SceneTree to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. an "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once.

godot.SceneTree is the default godot.MainLoop implementation used by scenes, and is thus in charge of the game loop.

Constructor

@:native("new")new()

Variables

@:native("CurrentScene")currentScene:Node

The current scene.

@:native("DebugCollisionsHint")debugCollisionsHint:Bool

If true, collision shapes will be visible when running the game from the editor for debugging purposes.

@:native("DebugNavigationHint")debugNavigationHint:Bool

If true, navigation polygons will be visible when running the game from the editor for debugging purposes.

@:native("EditedSceneRoot")editedSceneRoot:Node

The root of the edited scene.

@:native("Multiplayer")multiplayer:MultiplayerAPI

The default godot.MultiplayerAPI instance for this godot.SceneTree.

@:native("MultiplayerPoll")multiplayerPoll:Bool

If true (default value), enables automatic polling of the godot.MultiplayerAPI for this SceneTree during idle_frame.

If false, you need to manually call godot.MultiplayerAPI.poll to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual godot.Mutex protection when accessing the godot.MultiplayerAPI from threads.

@:native("NetworkPeer")networkPeer:NetworkedMultiplayerPeer

The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the godot.SceneTree will become a network server (check with godot.SceneTree.isNetworkServer) and will set the root node's network mode to master, or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to godot.SceneTree's signals.

read onlyonConnectedToServer:Signal<() ‑> Void>

connected_to_server signal.

read onlyonConnectionFailed:Signal<() ‑> Void>

connection_failed signal.

read onlyonFilesDropped:Signal<(files:Array<String>, screen:Int) ‑> Void>

files_dropped signal.

read onlyonGlobalMenuAction:Signal<(id:Any, meta:Any) ‑> Void>

global_menu_action signal.

read onlyonIdleFrame:Signal<() ‑> Void>

idle_frame signal.

read onlyonNetworkPeerConnected:Signal<(id:Int) ‑> Void>

network_peer_connected signal.

read onlyonNetworkPeerDisconnected:Signal<(id:Int) ‑> Void>

network_peer_disconnected signal.

read onlyonNodeAdded:Signal<(node:Node) ‑> Void>

node_added signal.

read onlyonNodeConfigurationWarningChanged:Signal<(node:Node) ‑> Void>

node_configuration_warning_changed signal.

read onlyonNodeRemoved:Signal<(node:Node) ‑> Void>

node_removed signal.

read onlyonNodeRenamed:Signal<(node:Node) ‑> Void>

node_renamed signal.

read onlyonPhysicsFrame:Signal<() ‑> Void>

physics_frame signal.

read onlyonScreenResized:Signal<() ‑> Void>

screen_resized signal.

read onlyonServerDisconnected:Signal<() ‑> Void>

server_disconnected signal.

read onlyonTreeChanged:Signal<() ‑> Void>

tree_changed signal.

@:native("Paused")paused:Bool

If true, the godot.SceneTree is paused. Doing so will have the following behavior:

@:native("RefuseNewNetworkConnections")refuseNewNetworkConnections:Bool

If true, the godot.SceneTree's godot.SceneTree.networkPeer refuses new incoming connections.

@:native("Root")read onlyroot:Viewport

@:native("UseFontOversampling")useFontOversampling:Bool

If true, font oversampling is enabled. This means that godot.DynamicFonts will be rendered at higher or lower size than configured based on the viewport's scaling ratio. For example, in a viewport scaled with a factor 1.5, a font configured with size 14 would be rendered with size 21 (14 * 1.5).

Note: Font oversampling is only used if the viewport stretch mode is godot.SceneTree_StretchMode.viewport, and if the stretch aspect mode is different from godot.SceneTree_StretchAspect.ignore.

Note: This property is set automatically for the active godot.SceneTree when the project starts based on the configuration of rendering/quality/dynamic_fonts/use_oversampling in godot.ProjectSettings. The property can however be overridden at runtime as needed.

Methods

@:native("CallGroup")callGroup(group:String, method:String, args:HaxeArray<Dynamic>):Dynamic

Calls method on each member of the given group. You can pass arguments to method by specifying them at the end of the method call. This method is equivalent of calling godot.SceneTree.callGroupFlags with godot.SceneTree_GroupCallFlags.default flag.

Note: method may only have 5 arguments at most (7 arguments passed to this method in total).

Note: Due to design limitations, godot.SceneTree.callGroup will fail silently if one of the arguments is null.

Note: godot.SceneTree.callGroup will always call methods with an one-frame delay, in a way similar to godot.Object.callDeferred. To call methods immediately, use godot.SceneTree.callGroupFlags with the godot.SceneTree_GroupCallFlags.realtime flag.

@:native("CallGroupFlags")callGroupFlags(flags:Int, group:String, method:String, args:HaxeArray<Dynamic>):Dynamic

Calls method on each member of the given group, respecting the given godot.SceneTree_GroupCallFlags. You can pass arguments to method by specifying them at the end of the method call.

Note: method may only have 5 arguments at most (8 arguments passed to this method in total).

Note: Due to design limitations, godot.SceneTree.callGroupFlags will fail silently if one of the arguments is null.


# Call the method immediately and in reverse order.
get_tree().call_group_flags(SceneTree.GROUP_CALL_REALTIME | SceneTree.GROUP_CALL_REVERSE, "bases", "destroy")

@:native("ChangeScene")changeScene(path:String):Error

Changes the running scene to the one at the given path, after loading it into a godot.PackedScene and creating a new instance.

Returns OK on success, ERR_CANT_OPEN if the path cannot be loaded into a godot.PackedScene, or ERR_CANT_CREATE if that scene cannot be instantiated.

Note: The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the godot.SceneTree.changeScene call.

@:native("ChangeSceneTo")changeSceneTo(packedScene:PackedScene):Error

Changes the running scene to a new instance of the given godot.PackedScene.

Returns OK on success or ERR_CANT_CREATE if the scene cannot be instantiated.

Note: The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the godot.SceneTree.changeSceneTo call.

Note: Passing a value of null into the method will unload the current scene without loading a new one.

@:native("CreateTimer")createTimer(timeSec:Single, ?pauseModeProcess:Bool):SceneTreeTimer

Returns a godot.SceneTreeTimer which will SceneTreeTimer.timeout after the given time in seconds elapsed in this godot.SceneTree. If pause_mode_process is set to false, pausing the godot.SceneTree will also pause the timer.

Commonly used to create a one-shot delay timer as in the following example:


func some_function():
print("start")
yield(get_tree().create_timer(1.0), "timeout")
print("end")

The timer will be automatically freed after its time elapses.

@:native("GetCurrentScene")getCurrentScene():Node

@:native("GetEditedSceneRoot")getEditedSceneRoot():Node

@:native("GetFrame")getFrame():Int64

Returns the current frame number, i.e. the total frame count since the application started.

@:native("GetMultiplayer")getMultiplayer():MultiplayerAPI

inlinegetNetworkConnectedPeers():Array<Int>

Returns the peer IDs of all connected peers of this godot.SceneTree's godot.SceneTree.networkPeer.

@:native("GetNetworkPeer")getNetworkPeer():NetworkedMultiplayerPeer

@:native("GetNetworkUniqueId")getNetworkUniqueId():Int

Returns the unique peer ID of this godot.SceneTree's godot.SceneTree.networkPeer.

@:native("GetNodeCount")getNodeCount():Int

Returns the number of nodes in this godot.SceneTree.

@:native("GetNodesInGroup")getNodesInGroup(group:String):Array

Returns a list of all nodes assigned to the given group.

@:native("GetRoot")getRoot():Viewport

@:native("GetRpcSenderId")getRpcSenderId():Int

Returns the sender's peer ID for the most recently received RPC call.

@:native("HasGroup")hasGroup(name:String):Bool

Returns true if the given group exists.

@:native("HasNetworkPeer")hasNetworkPeer():Bool

Returns true if there is a godot.SceneTree.networkPeer set.

@:native("IsDebuggingCollisionsHint")isDebuggingCollisionsHint():Bool

@:native("IsDebuggingNavigationHint")isDebuggingNavigationHint():Bool

@:native("IsInputHandled")isInputHandled():Bool

Returns true if the most recent godot.InputEvent was marked as handled with godot.SceneTree.setInputAsHandled.

@:native("IsMultiplayerPollEnabled")isMultiplayerPollEnabled():Bool

@:native("IsNetworkServer")isNetworkServer():Bool

Returns true if this godot.SceneTree's godot.SceneTree.networkPeer is in server mode (listening for connections).

@:native("IsPaused")isPaused():Bool

@:native("IsRefusingNewNetworkConnections")isRefusingNewNetworkConnections():Bool

@:native("IsUsingFontOversampling")isUsingFontOversampling():Bool

@:native("NotifyGroup")notifyGroup(group:String, notification:Int):Void

Sends the given notification to all members of the group.

@:native("NotifyGroupFlags")notifyGroupFlags(callFlags:UInt, group:String, notification:Int):Void

Sends the given notification to all members of the group, respecting the given godot.SceneTree_GroupCallFlags.

@:native("QueueDelete")queueDelete(obj:Object):Void

Queues the given object for deletion, delaying the call to godot.Object.free to after the current frame.

@:native("Quit")quit(?exitCode:Int):Void

Quits the application at the end of the current iteration. A process exit_code can optionally be passed as an argument. If this argument is 0 or greater, it will override the godot.OS.exitCode defined before quitting the application.

Note: On iOS this method doesn't work. Instead, as recommended by the iOS Human Interface Guidelines, the user is expected to close apps via the Home button.

@:native("ReloadCurrentScene")reloadCurrentScene():Error

Reloads the currently active scene.

Returns OK on success, ERR_UNCONFIGURED if no godot.SceneTree.currentScene was defined yet, ERR_CANT_OPEN if godot.SceneTree.currentScene cannot be loaded into a godot.PackedScene, or ERR_CANT_CREATE if the scene cannot be instantiated.

@:native("SetAutoAcceptQuit")setAutoAcceptQuit(enabled:Bool):Void

If true, the application automatically accepts quitting. Enabled by default.

For mobile platforms, see godot.SceneTree.setQuitOnGoBack.

@:native("SetCurrentScene")setCurrentScene(childNode:Node):Void

@:native("SetDebugCollisionsHint")setDebugCollisionsHint(enable:Bool):Void

@:native("SetDebugNavigationHint")setDebugNavigationHint(enable:Bool):Void

@:native("SetEditedSceneRoot")setEditedSceneRoot(scene:Node):Void

@:native("SetGroup")setGroup(group:String, property:String, value:Dynamic):Void

Sets the given property to value on all members of the given group.

@:native("SetGroupFlags")setGroupFlags(callFlags:UInt, group:String, property:String, value:Dynamic):Void

Sets the given property to value on all members of the given group, respecting the given godot.SceneTree_GroupCallFlags.

@:native("SetInputAsHandled")setInputAsHandled():Void

Marks the most recent godot.InputEvent as handled.

@:native("SetMultiplayer")setMultiplayer(multiplayer:MultiplayerAPI):Void

@:native("SetMultiplayerPollEnabled")setMultiplayerPollEnabled(enabled:Bool):Void

@:native("SetNetworkPeer")setNetworkPeer(peer:NetworkedMultiplayerPeer):Void

@:native("SetPause")setPause(enable:Bool):Void

@:native("SetQuitOnGoBack")setQuitOnGoBack(enabled:Bool):Void

If true, the application quits automatically on going back (e.g. on Android). Enabled by default.

To handle 'Go Back' button when this option is disabled, use godot.MainLoop.notificationWmGoBackRequest.

@:native("SetRefuseNewNetworkConnections")setRefuseNewNetworkConnections(refuse:Bool):Void

@:native("SetScreenStretch")setScreenStretch(mode:SceneTree_StretchMode, aspect:SceneTree_StretchAspect, minsize:Vector2, ?scale:Single):Void

Configures screen stretching to the given godot.SceneTree_StretchMode, godot.SceneTree_StretchAspect, minimum size and scale.

@:native("SetUseFontOversampling")setUseFontOversampling(enable:Bool):Void

Inherited Variables

Defined by MainLoop

read onlyonOnRequestPermissionsResult:Signal<(permission:String, granted:Bool) ‑> Void>

on_request_permissions_result signal.

Defined by Object

@:native("DynamicObject")read onlydynamicObject:Dynamic

Gets a new godot.DynamicGodotObject associated with this instance.

@:native("NativeInstance")read onlynativeInstance:IntPtr

The pointer to the native instance of this godot.Object.

read onlyonScriptChanged:Signal<() ‑> Void>

script_changed signal.

Inherited Methods

Defined by MainLoop

@:native("_DropFiles")_DropFiles(files:HaxeArray<String>, fromScreen:Int):Void

Called when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated.

@:native("_Finalize")_Finalize():Void

Called before the program exits.

@:native("_GlobalMenuAction")_GlobalMenuAction(id:Dynamic, meta:Dynamic):Void

Called when the user performs an action in the system global menu (e.g. the Mac OS menu bar).

@:native("_Idle")_Idle(delta:Single):Bool

Called each idle frame with the time since the last idle frame as argument (in seconds). Equivalent to godot.Node._Process.

If implemented, the method must return a boolean value. true ends the main loop, while false lets it proceed to the next frame.

@:native("_Initialize")_Initialize():Void

Called once during initialization.

@:native("_InputEvent")_InputEvent(event:InputEvent):Void

Called whenever an godot.InputEvent is received by the main loop.

@:native("_InputText")_InputText(text:String):Void

Deprecated callback, does not do anything. Use godot.MainLoop._InputEvent to parse text input. Will be removed in Godot 4.0.

@:native("_Iteration")_Iteration(delta:Single):Bool

Called each physics frame with the time since the last physics frame as argument (delta, in seconds). Equivalent to godot.Node._PhysicsProcess.

If implemented, the method must return a boolean value. true ends the main loop, while false lets it proceed to the next frame.

@:native("Finish")finish():Void

Should not be called manually, override godot.MainLoop._Finalize instead. Will be removed in Godot 4.0.

@:native("Idle")idle(delta:Single):Bool

Should not be called manually, override godot.MainLoop._Idle instead. Will be removed in Godot 4.0.

@:native("Init")init():Void

Should not be called manually, override godot.MainLoop._Initialize instead. Will be removed in Godot 4.0.

@:native("InputEvent")inputEvent(event:InputEvent):Void

Should not be called manually, override godot.MainLoop._InputEvent instead. Will be removed in Godot 4.0.

@:native("InputText")inputText(text:String):Void

Should not be called manually, override godot.MainLoop._InputText instead. Will be removed in Godot 4.0.

@:native("Iteration")iteration(delta:Single):Bool

Should not be called manually, override godot.MainLoop._Iteration instead. Will be removed in Godot 4.0.

Defined by Object

@:native("_Get")_Get(property:String):Dynamic

Virtual method which can be overridden to customize the return value of godot.Object.get.

Returns the given property. Returns null if the property does not exist.

@:native("_GetPropertyList")_GetPropertyList():Array

Virtual method which can be overridden to customize the return value of godot.Object.getPropertyList.

Returns the object's property list as an godot.Collections_Array of dictionaries.

Each property's godot.Collections_Dictionary must contain at least name: String and type: int (see godot.Variant_Type) entries. Optionally, it can also include hint: int (see godot.PropertyHint), hint_string: String, and usage: int (see godot.PropertyUsageFlags).

@:native("_Notification")_Notification(what:Int):Void

Called whenever the object receives a notification, which is identified in what by a constant. The base godot.Object has two constants godot.Object.notificationPostinitialize and godot.Object.notificationPredelete, but subclasses such as godot.Node define a lot more notifications which are also received by this method.

@:native("_Set")_Set(property:String, value:Dynamic):Bool

Virtual method which can be overridden to customize the return value of godot.Object.set.

Sets a property. Returns true if the property exists.

@:native("AddUserSignal")addUserSignal(signal:String, ?arguments:Array):Void

Adds a user-defined signal. Arguments are optional, but can be added as an godot.Collections_Array of dictionaries, each containing name: String and type: int (see godot.Variant_Type) entries.

Parameters:

arguments

If the parameter is null, then the default value is new Godot.Collections.Array { }

@:native("Call")call(method:String, args:HaxeArray<Dynamic>):Dynamic

Calls the method on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


call("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

@:native("CallDeferred")callDeferred(method:String, args:HaxeArray<Dynamic>):Void

Calls the method on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


call_deferred("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

@:native("Callv")callv(method:String, argArray:Array):Dynamic

Calls the method on the object and returns the result. Contrarily to godot.Object.call, this method does not support a variable number of arguments but expects all parameters to be via a single godot.Collections_Array.


callv("set", [ "position", Vector2(42.0, 0.0) ])

@:native("CanTranslateMessages")canTranslateMessages():Bool

Returns true if the object can translate strings. See godot.Object.setMessageTranslation and godot.Object.tr.

@:native("Connect")connect(signal:String, target:Object, method:String, ?binds:Array, ?flags:UInt):Error

Connects a signal to a method on a target object. Pass optional binds to the call as an godot.Collections_Array of parameters. These parameters will be passed to the method after any parameter used in the call to godot.Object.emitSignal. Use flags to set deferred or one-shot connections. See godot.Object_ConnectFlags constants.

A signal can only be connected once to a method. It will print an error if already connected, unless the signal was connected with godot.Object_ConnectFlags.referenceCounted. To avoid this, first, use godot.Object.isConnected to check for existing connections.

If the target is destroyed in the game's lifecycle, the connection will be lost.

Examples:


connect("pressed", self, "_on_Button_pressed") # BaseButton signal
connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal
connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal

An example of the relationship between binds passed to godot.Object.connect and parameters used when calling godot.Object.emitSignal:


connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # weapon_type and damage are passed last
emit_signal("hit", "Dark lord", 5) # "Dark lord" and 5 are passed first
func _on_Player_hit(hit_by, level, weapon_type, damage):
print("Hit by %s (lvl %d) with weapon %s for %d damage" % [hit_by, level, weapon_type, damage])

Parameters:

binds

If the parameter is null, then the default value is new Godot.Collections.Array { }

@:native("Disconnect")disconnect(signal:String, target:Object, method:String):Void

Disconnects a signal from a method on the given target.

If you try to disconnect a connection that does not exist, the method will print an error. Use godot.Object.isConnected to ensure that the connection exists.

@:native("Dispose")dispose():Void

@:native("Dispose")@:protectedDispose(disposing:Bool):Void

Disposes of this godot.Object.

@:native("EmitSignal")emitSignal(signal:String, args:HaxeArray<Dynamic>):Void

Emits the given signal. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


emit_signal("hit", weapon_type, damage)
emit_signal("game_over")

@:native("Free")free():Void

Deletes the object from memory immediately. For godot.Nodes, you may want to use godot.Node.queueFree to queue the node for safe deletion at the end of the current frame.

Important: If you have a variable pointing to an object, it will not be assigned to null once the object is freed. Instead, it will point to a previously freed instance and you should validate it with @GDScript.is_instance_valid before attempting to call its methods or access its properties.

@:native("Get")get(property:String):Dynamic

Returns the Variant value of the given property. If the property doesn't exist, this will return null.

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("GetClass")getClass():String

Returns the object's class as a String. See also godot.Object.isClass.

Note: godot.Object.getClass does not take class_name declarations into account. If the object has a class_name defined, the base class name will be returned instead.

@:native("GetIncomingConnections")getIncomingConnections():Array

Returns an godot.Collections_Array of dictionaries with information about signals that are connected to the object.

Each godot.Collections_Dictionary contains three String entries:

  • source is a reference to the signal emitter.

  • signal_name is the name of the connected signal.

  • method_name is the name of the method to which the signal is connected.

@:native("GetIndexed")getIndexed(property:NodePath):Dynamic

Gets the object's property indexed by the given godot.NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Examples: "position:x" or "material:next_pass:blend_mode".

Note: Even though the method takes godot.NodePath argument, it doesn't support actual paths to godot.Nodes in the scene tree, only colon-separated sub-property paths. For the purpose of nodes, use godot.Node.getNodeAndResource instead.

@:native("GetInstanceId")getInstanceId():UInt64

Returns the object's unique instance ID.

This ID can be saved in godot.EncodedObjectAsID, and can be used to retrieve the object instance with @GDScript.instance_from_id.

@:native("GetMeta")getMeta(name:String):Dynamic

Returns the object's metadata entry for the given name.

inlinegetMetaList():Array<String>

Returns the object's metadata as a String.

@:native("GetMethodList")getMethodList():Array

Returns the object's methods and their signatures as an godot.Collections_Array.

@:native("GetPropertyList")getPropertyList():Array

Returns the object's property list as an godot.Collections_Array of dictionaries.

Each property's godot.Collections_Dictionary contain at least name: String and type: int (see godot.Variant_Type) entries. Optionally, it can also include hint: int (see godot.PropertyHint), hint_string: String, and usage: int (see godot.PropertyUsageFlags).

@:native("GetScript")getScript():Reference

Returns the object's godot.Script instance, or null if none is assigned.

@:native("GetSignalConnectionList")getSignalConnectionList(signal:String):Array

Returns an godot.Collections_Array of connections for the given signal.

@:native("GetSignalList")getSignalList():Array

Returns the list of signals as an godot.Collections_Array of dictionaries.

@:native("HasMeta")hasMeta(name:String):Bool

Returns true if a metadata entry is found with the given name.

@:native("HasMethod")hasMethod(method:String):Bool

Returns true if the object contains the given method.

@:native("HasSignal")hasSignal(signal:String):Bool

Returns true if the given signal exists.

@:native("HasUserSignal")hasUserSignal(signal:String):Bool

Returns true if the given user-defined signal exists. Only signals added using godot.Object.addUserSignal are taken into account.

@:native("IsBlockingSignals")isBlockingSignals():Bool

Returns true if signal emission blocking is enabled.

@:native("IsClass")isClass(class_:String):Bool

Returns true if the object inherits from the given class. See also godot.Object.getClass.

Note: godot.Object.isClass does not take class_name declarations into account. If the object has a class_name defined, godot.Object.isClass will return false for that name.

@:native("IsConnected")isConnected(signal:String, target:Object, method:String):Bool

Returns true if a connection exists for a given signal, target, and method.

@:native("IsQueuedForDeletion")isQueuedForDeletion():Bool

Returns true if the godot.Node.queueFree method was called for the object.

@:native("Notification")notification(what:Int, ?reversed:Bool):Void

Send a given notification to the object, which will also trigger a call to the godot.Object._Notification method of all classes that the object inherits from.

If reversed is true, godot.Object._Notification is called first on the object's own class, and then up to its successive parent classes. If reversed is false, godot.Object._Notification is called first on the highest ancestor (godot.Object itself), and then down to its successive inheriting classes.

@:native("PropertyListChangedNotify")propertyListChangedNotify():Void

Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds.

@:native("RemoveMeta")removeMeta(name:String):Void

Removes a given entry from the object's metadata. See also godot.Object.setMeta.

@:native("Set")set(property:String, value:Dynamic):Void

Assigns a new value to the given property. If the property does not exist or the given value's type doesn't match, nothing will happen.

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("SetBlockSignals")setBlockSignals(enable:Bool):Void

If set to true, signal emission is blocked.

@:native("SetDeferred")setDeferred(property:String, value:Dynamic):Void

Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling godot.Object.set via godot.Object.callDeferred, i.e. call_deferred("set", property, value).

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("SetIndexed")setIndexed(property:NodePath, value:Dynamic):Void

Assigns a new value to the property identified by the godot.NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Example:


set_indexed("position", Vector2(42, 0))
set_indexed("position:y", -10)
print(position) # (42, -10)

@:native("SetMessageTranslation")setMessageTranslation(enable:Bool):Void

Defines whether the object can translate strings (with calls to godot.Object.tr). Enabled by default.

@:native("SetMeta")setMeta(name:String, value:Dynamic):Void

Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any Variant value.

To remove a given entry from the object's metadata, use godot.Object.removeMeta. Metadata is also removed if its value is set to null. This means you can also use set_meta("name", null) to remove metadata for "name".

@:native("SetScript")setScript(script:Reference):Void

Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality.

If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script's method will be called.

@:native("ToSignal")toSignal(source:Object, signal:String):SignalAwaiter

Returns a new godot.SignalAwaiter awaiter configured to complete when the instance source emits the signal specified by the signal parameter.

Parameters:

source

The instance the awaiter will be listening to.

signal

The signal the awaiter will be waiting for. This sample prints a message once every frame up to 100 times.

public override void _Ready()
{
for (int i = 0; i &lt; 100; i++)
{
await ToSignal(GetTree(), "idle_frame");
GD.Print($"Frame {i}");
}
}

Returns:

A godot.SignalAwaiter that completes when source emits the signal.

@:native("ToString")toString():String

Converts this godot.Object to a string.

Returns:

A string representation of this object.

@:native("Tr")tr(message:String):String

Translates a message using translation catalogs configured in the Project Settings.

Only works if message translation is enabled (which it is by default), otherwise it returns the message unchanged. See godot.Object.setMessageTranslation.