0 votes

Hello,
in my Control parent "Project" i want to set an GridContainer child "tasks" to a specific global position; in "Project" i call in the _ready() function:

tasks.set_global_position(Vector2(rect_size.x, 0))

I expect that for all "Project" object instances, each corresponding "tasks" child has the exact same position so they are overlapping. Unfortunately this is not happening: The "tasks" child appears always to the right of the "Project" instance.

Am i getting something wrong or why is this not working?
Thanks in advance!

PS: here is the whole project: https://github.com/Wendelstein91/Goalify0300
The problem occurs in Project.gd.

Godot version 3.4.2
in Engine by (32 points)
edited by

This is still unsolved for me.
I updated the project: please help me...

Hello,
can you provide your project on github again or make a Screenshot of your Scene Tree?

Hello juppi,
whats the problem with the link above? It should work.

Oh yeah. I see. There's a dot at the end of the URL.

So, I think that doesn't work with that kind of Node.

The documentations says:

Grid container used to arrange Control-derived children in a grid like
layout. ... ... GridContainer will arrange its Control-derived
children in a grid like structure, ... Note: GridContainer only works
with child nodes inheriting from Control. It won't rearrange child
nodes inheriting from Node2D.

https://docs.godotengine.org/en/stable/classes/class_gridcontainer.html

Thank you for your respond, i removed the dot from the link.
The point is, i do not want to rearrange children of the GridContainer,
i just want to set the position of a GridContainer which is a child.
The strange thing with my project is:
Project instances have one own GridContainer and task instances also have one.
The positioning of the GridContainer of tasks works while that of the projects child GridContainer doesnt work.

In short:
-Projectinstance
-GridContainer (positioning false)
-Task
instance
-GridContainer (positioning ok)

you can simply check this if you run the project, add 2 projects by clicking "+". Then attach 2 tasks to each of this projects by clicking "+" button of the projects and then do the same for the four tasks to add todos to each task. You will see that the tasks of project two will have an y-offset that todos of tasks will not have.

Please log in or register to answer this question.

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.