+2 votes

Hi there,

I created a HBox by code, and I am trying to change the separation of its child thought his property "separation", but I donĀ“t get the result.

Hbox_ref = HBoxContainer.new()
Vbox_Ref.add_child(Hbox_ref)
Hbox_ref.custom_constants/separation = 0

Where is the problem? Can you guys give me a hint?

asked May 22, 2018 in Engine by Mezkino (23 points)

1 Answer

+3 votes

You cannot directly access an attribute that has slashes in its path.

You need

Hbox_ref.set("custom_constants/separation", 0)
answered May 23, 2018 by Diet Estus (1,504 points)

Awesome, it works perfectly,

Really thank you :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.