Material Box

Material Box

WEB Design & Material Images

Godot - Get parent node

Godot

How to get parent node from child node in Godot GDScript.


Can get parent node using get_parent().

vat parent_node = get_parent()

To get grandparent node 2 levels up, chain get_parent() calls.
If hierarchy above root is specified, returns Object#null.

vat parent_node = get_parent().get_parent()

Godot

TitleGodot - Get parent node

CategoryGodot

Created

Update

AuthorYousuke.U