diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-08-09 18:16:45 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-08-09 20:21:04 -0700 |
commit | ec9fed69f4676e42e677c551423cd5f5c8f13100 (patch) | |
tree | a1835870914ec82443c149f9bad7a5ebebc80b34 /doc/classes/CharacterBody3D.xml | |
parent | f3ddc14d3829ed09d6eab81811bcfb1314626ddf (diff) |
Fix 3D moving platform logic
Same thing that was already done in 2D, applies moving platform motion
by using a call to move_and_collide that excludes the platform itself,
instead of making it part of the body motion.
Helps with handling walls and slopes correctly when the character walks
on the moving platform.
Also made some minor adjustments to the 2D version and documentation.
Co-authored-by: fabriceci <fabricecipolla@gmail.com>
Diffstat (limited to 'doc/classes/CharacterBody3D.xml')
-rw-r--r-- | doc/classes/CharacterBody3D.xml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 577ab5e84c..4cb4f9a850 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -65,6 +65,7 @@ Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. Modifies [member linear_velocity] if a slide collision occurred. To get detailed information about collisions that occurred, use [method get_slide_collision]. + When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. </description> </method> </methods> |