godot area determination
Asked Answered
H

4

0

You mean you want to throw the balls randomly, but confine them to a certain area?

What code are you using to throw the balls?

Hardy answered 8/1 at 17:38 Comment(0)
H
0

Sallet I use GdScript codes

The actual code would be helpful in answering your question.

Hardy answered 8/1 at 18:19 Comment(0)
P
0

Sallet codes

Off topic, but I can't resist as this is one of my pet peeves 🙂
https://english.stackexchange.com/questions/20455/is-it-wrong-to-use-the-word-codes-in-a-programming-context#20456

Pianoforte answered 8/1 at 18:26 Comment(0)
H
0

So tops is a node (maybe a Sprite2D or TextureRect) whose Sprite2D children are the balls.

You want to place those balls at random positions within a rectangle defined by xmin=50, ymin=50, xmax=350, ymax=350.

There are also constraints such as vertical_spacing and distance. The posted code doesn't show how some of the variables are initialized, such as current_row, new_location, current_top.location.

How is the code failing?

If you could upload a complete, minimal project that uses that code, we could test it.

Hardy answered 8/1 at 20:9 Comment(0)
P
0

Sallet the code does not fail

Then you have no problem. "Failing" in this context doesn't necessarily mean throwing an error. Dolor is asking what results is your existing code producing versus what are you expecting it to produce.

Pianoforte answered 9/1 at 13:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.