[Godot 3.0 beta 2] how to get root node?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Pin
:warning: Old Version Published before Godot 3 was released.

how to get root node using gdscript?
this code doesn’t work anymore in godot 3.0

get_tree().get_root().get_visible_rect().size

what are you trying to do?
getting viewport size?

func _ready():
    print(get_tree().get_root().get_visible_rect().size)

this code works as expected with godot 3.0 in my case.

volzhs | 2017-12-25 18:05

Sorry for the late reply

I’m getting viewport size.
yes.

Strange This code now working! must be typo :smiley:

Should i delete this post?

Pin | 2017-12-26 06:19

don’t have to :slight_smile:

volzhs | 2017-12-26 06:35