0
\$\begingroup\$

When I try to create a "ColorRect" in code, it doesn't display. It still seems to exist, but I can't see it.

I am expecting to see both the rect created in the editor at x=32 y=32 and the one created in GDScript at x=128 y=32, but I can only see the one created in the editor, as shown in the following picture:

Cropped anotated screenshot showing the project described

I am using version 3.5.2 of Godot.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

Answered by Reddit

The default size when created in code is Vector2(0,0) instead of Vector2(40,40).
This issue is fixed by giving the Rect a size.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.