From 68f0cf97bcc21e69f4810d7c8da61f7db7e63b25 Mon Sep 17 00:00:00 2001 From: fabriceci Date: Tue, 17 Aug 2021 23:31:26 +0200 Subject: add motion mode to handle TPS --- doc/classes/CharacterBody2D.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/classes') diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index e23ceedc28..e5f60541b9 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -111,6 +111,7 @@ 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 the latest collision call [method get_last_slide_collision], for 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. + The general behaviour and available properties change according to the [member motion_mode]. Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. @@ -139,12 +140,18 @@ If [code]true[/code], the body will not slide on floor's slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. + + Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. + Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. + + Sets the motion mode which defines the behaviour of [method move_and_slide]. See [enum MotionMode] constants for available modes. + Collision layers that will be excluded for detecting bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all touching bodies are detected and propagate their velocity. You can add excluded layers to ignore bodies that are contained in these layers. @@ -156,5 +163,11 @@ + + Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for sided games like platformers. + + + Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will be always constant. This mode is suitable for top-down games. + -- cgit v1.2.3