godotengine / godotengine/godot-docs

Add a note for `add_force` and `add_central_force` that may be used inside `physics_process` to work as expected

Open
#6,487 1 comment 0 reactions 0 assignees View on GitHub
area:class reference enhancement topic:physics
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**

3.5

**Issue description:**

I spent hours of debugging when I discovered that those methods just need to be used in `physics_process`. I thought that those functions worked like `apply_impulse` which you call once and then the physics engine would do the rest, but is not the case.
I think it would be good to clarify this in the docs.

To test what i'm saying, just add a RigidBody, then in `_ready` call `add_force` for that RigidBody. Since the call is made once, nothing happens and the body stays quiet (if you cancel gravity with gravity scale).

**URL to the documentation page (if already existing):**

For Godot 4: https://docs.godotengine.org/en/latest/classes/class_rigidbody3d.html#class-rigidbody3d-method-apply-force

For Godot 3: https://docs.godotengine.org/en/stable/classes/class_rigidbody.html#class-rigidbody-method-add-force

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.