Hello, I am suffering for the second day. There is a large cube made up of smaller cubes that can be destroyed. How to make gravity on this cube? So that you can walk on either side and jump over to the other side? help me please

in Engine

I've tried in a basic project and it seems to work so you could use an `Area` with a rectangle collision shape. This will represent the space where there's gravity.

Under the `area` you set the `space_override` property to something else that disabled. (See the values https://docs.godotengine.org/fr/stable/classes/class_area.html#enumerations).
You should also set `gravity_point` to `true` and `gravity_vec` to `Vector3(0, 0, 0)`

EDIT: For completeness. If you want to use a `gravity_vector` and modify it at runtime, as of Godot 3.3 rc6 it still doesn't work with `Bullet` so you should use Godot physics instead.

Under `Project Settings > General > Physics > 3D > Physics Engine` choose `GodotPhysics`.

by (621 points)
edited

Forgive me for so many questions, I'm already ashamed to ask. Why does `gravityArea.gravity_vec = Vector3 (0,0,1)` only work in the `_ready function`? Neither in `physics_process (delta)` nor in `process (delta)` gravity change does not work.

``````func _ready():
gravityArea.gravity_vec = Vector3(0,0,1)
``````

everything works

``````func _physics_process(delta):
if Input.is_action_just_pressed("num1"):
gravityArea.gravity_vec = Vector3(0,-1,0)
print(gravityArea.gravity_vec)

if Input.is_action_just_pressed("num2"):
gravityArea.gravity_vec = Vector3(0,0,1)
print(gravityArea.gravity_vec)
``````

does not work, although it is written in the console output that the vectors are changing

I've tried on my side and you're right it doesn't work if you try to change the vector at runtime. I now remember, I've found a bug in `Bullet physics`, you should use `Godot physics` instead.

Under `Project Settings > General > Physics > 3D > Physics Engine` choose `GodotPhysics`. It should work now! I just tested it in a small project.

If you run the scene and press space, it will toggle between `Vector3(0, -1, 0)` and `Vector3(0, 1, 0)`