Godot C# OnEnable(); OnDisable();

Godot 4.2 Mono

Hello community, is it possible to track Node3D if it is active and visible in the scene? I came from Unity Engine and there are methods OnEnable() code in the method is called when the state of the object and OnDisable() code in the method is called when the state of the object is turned off. Is there something like this in Godot?

PS: I once saw on the forums a certain implementation through VIsibility_Changed signals in Node3D

Visibility is not working like Enabling, Disabling Objects in Unity,
public override void _EnterTree() and public override void _ExitTree() is should be sufficient. Of course you can create enebler disabler script with logic and put whatever you want.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.