Skip to content

Commit ebc3777

Browse files
[Auto] [Improve] Fixed behavior lifecycle method names and updated collision doc Physics 2 references (#476)
1 parent 84ee9ee commit ebc3777

3 files changed

Lines changed: 19 additions & 17 deletions

File tree

automated_updates_data.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
{
5757
"date": "2026-02-22",
5858
"summary": "Fixed publishing docs: removed outdated 'iOS coming soon' claim, fixed broken mobile links, updated Android sideloading instructions for Android 8+, and clarified macOS/Windows security bypass steps"
59+
},
60+
{
61+
"date": "2026-02-24",
62+
"summary": "Fixed custom behavior lifecycle method names (onStepPreEvents/onStepPostEvents → doStepPreEvents/doStepPostEvents) and updated collisions doc to reference Physics 2 instead of deprecated Physics behavior"
5963
}
6064
]
6165
}

docs/gdevelop5/all-features/collisions/index.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ GDevelop provides several different ways to handle collisions. You can detect co
1010
## Make objects solids: use the "Separate objects" action (good for top-down games, RPG...)
1111
![](/gdevelop5/all-features/separate-condition.png)
1212

13-
You can use the "**Separate objects**" action to move objects manually. The "Separate objects" action can also move objects with "forces" or set the object's position.
14-
15-
"**Separate objects.**" This action takes two object names as the argument.
13+
"**Separate objects**" is an action that keeps two types of objects from overlapping. It takes two object names as the argument.
1614

1715
* The first object name is the _object moving_ (the player, enemy, etc.).
1816
* The second object name is an _object (or a group of objects) that are solid_. For example, these objects can be the walls.
@@ -25,7 +23,7 @@ This action will be launched in every frame. In an event without conditions, the
2523

2624
### Detect collisions
2725

28-
Using "Separate objects" is a good way to ensure that your objects can't move into other solid objects. This action checks collisions between objects. For example, if the game object "player" is touching a wall, this action, when used with the condition called "**Collision,**" will trigger damages to the player.
26+
Using "Separate objects" is a good way to ensure that your objects can't move into other solid objects. You can pair it with the "**Collision**" condition to both detect a collision and react to it — for example, dealing damage to the player when touching an enemy, then separating them.
2927

3028
**The sequence is important.**
3129

@@ -63,21 +61,21 @@ In a platformer game with the "Platformer character" behavior, collisions with p
6361
**See it in action!** 🎮
6462
Open this example online: [Platformer Example](https://editor.gdevelop.io?project=example://platformer)
6563

66-
## Game with physics? Use the Physics behavior
64+
## Game with physics? Use the Physics 2 behavior
6765

68-
Use [Physics behavior](/gdevelop5/behaviors/physics) in order to achieve realistic physical behavior in your game. Attach "Physics" behavior to your objects. The objects will then behave as though they are alive in the game world. Some examples of real-world behavior include bouncing balls, falling, jumping, etc.
66+
Use the [Physics 2 behavior](/gdevelop5/behaviors/physics2) to make objects move realistically, simulating gravity, bouncing, and other real-world physical interactions. This is well suited for games like pinball, angry-birds-style projectile games, or anything that relies on natural-feeling collisions and movement.
6967

70-
Configure game walls or solid objects that should not move with "static" behavior.
68+
Objects configured as **Static** will not move and act as immovable walls or ground. Objects configured as **Dynamic** are fully simulated and react to gravity, forces, and collisions.
7169

72-
### Detect collisions with the Physics behavior
70+
### Detect collisions with the Physics 2 behavior
7371

74-
When you're using the **Physics** behavior, _do not use_ the **Collision** condition that is in the **Features for all objects** category. _The physics engine will manage all collisions by itself._ The Collision condition won't correctly detect when objects are touching.
72+
When you're using the **Physics 2** behavior, _do not use_ the **Collision** condition that is in the **Features for all objects** category. _The physics engine will manage all collisions by itself._ The standard Collision condition won't correctly detect when objects are touching.
7573

76-
Instead, use the Collision condition _inside the_ **Physics** _behavior category_, which properly uses the physics engine to simulate the collisions.
74+
Instead, use the Collision condition _inside the_ **Physics 2** _behavior category_, which properly uses the physics engine to simulate the collisions.
7775

7876
![](/gdevelop5/all-features/usephysicsbehaviornotcollisionconditionnew.png)
7977

80-
Additionally, objects with the **Physics** behavior ignore the object's Collision Masks and instead use the collision information on the **BEHAVIORS** tab of the object itself. This defaults to a box that is the full dimension of the object. In most cases, there will be a need to change these settings from within the **BEHAVIORS** tab.
78+
Additionally, objects with the **Physics 2** behavior ignore the object's Collision Masks and instead use the collision shape configured on the **BEHAVIORS** tab of the object itself. This defaults to a box matching the full dimensions of the object. The shape can be changed to a circle, edge, or polygon from within the **BEHAVIORS** tab.
8179
![](/gdevelop5/all-features/physics_hitbox.png)
8280
!!! tip
8381

docs/gdevelop5/behaviors/events-based-behaviors/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ Events from the **onCreated** function are run when a new instance of an object
5757

5858
### Run events every frame
5959

60-
Events from the **onStepPreEvents** function are run every time a frame is rendering on the screen before the "traditional" events of the scene. Typically this is done 60 times per second. It's called for every single object having the behavior unless it's deactivated.
60+
Events from the **doStepPreEvents** function are run every time a frame is rendering on the screen before the "traditional" events of the scene. Typically this is done 60 times per second. It's called for every single object having the behavior unless it's deactivated.
6161

62-
The following `onStepPreEvents` function events automatically deletes objects that are too damaged:
62+
The following `doStepPreEvents` function events automatically deletes objects that are too damaged:
6363

6464
![](pasted/20210906-235321.png)
6565

6666
### Add custom action, condition or expression
6767

6868
Behaviors and the scene events communicate through functions:
6969

70-
- Actions allow to change the state of the behavior and maybe initiate an effect over time in the `onStepPreEvents` function. For instance, a jump action changes the character state from standing to jumping and `onStepPreEvents` modify the character position on Y axis every frame.
70+
- Actions allow to change the state of the behavior and maybe initiate an effect over time in the `doStepPreEvents` function. For instance, a jump action changes the character state from standing to jumping and `doStepPreEvents` modify the character position on Y axis every frame.
7171
- Conditions let scene events know about behavior state changes. For instance, a condition can allow to check if a character is jumping.
7272

7373
!!! tip
@@ -80,12 +80,12 @@ For example, this function defines an action that can be used to add damage to t
8080

8181
### Run events at other lifecycle key times
8282

83-
Even though, the lifecycle functions **onCreated** and **onStepPreEvents** are the most common, the following function can also be used:
83+
Even though, the lifecycle functions **onCreated** and **doStepPreEvents** are the most common, the following function can also be used:
8484

8585
* **onDestroy**: events that will be run when an instance of the object having the behavior is deleted (if multiple objects are removed at the same time, events will be run for each object). This is done even if the behavior is deactivated.
8686
* **onDeActivate**: events that will be run once, after the behavior is deactivated on an object.
8787
* **onActivate**: events that will be run once, after the behavior is activated again on an object.
88-
* **onStepPostEvents**: events that will be run for every single object having the behavior, after the "traditional" events of the scene, if the behavior is not deactivated. Typically, this is done 60 times per second. It's recommend to prefer `onStepPreEvents`, to run your logic before events and give the events in the scene a chance to react to changes that happen on the objects.
88+
* **doStepPostEvents**: events that will be run for every single object having the behavior, after the "traditional" events of the scene, if the behavior is not deactivated. Typically, this is done 60 times per second. It's recommended to prefer `doStepPreEvents`, to run your logic before events and give the events in the scene a chance to react to changes that happen on the objects.
8989

9090
## Use the behavior on an object
9191

@@ -101,7 +101,7 @@ The custom behavior that you created is then displayed in the list of the behavi
101101

102102
![](pasted/20210907-000202.png)
103103

104-
You can run the game and see that the events in "doStepPreEvents" function (or "doStepPostEvents") will be executed. In the example of the Destructible behavior that was created, if the "Damage" variable is set to a number greater or equal to 100, the object will be destroyed automatically.
104+
You can run the game and see that the events in the `doStepPreEvents` function (or `doStepPostEvents`) will be executed. In the example of the Destructible behavior that was created, if the "Damage" variable is set to a number greater or equal to 100, the object will be destroyed automatically.
105105

106106
To test this, we've added the "Destructible" behavior to object "Platform". Then, when using the debugger, we can inspect "Platform" instances and see that they have a "Damage" variable (set to 0). If we use the debugger (or an event) to set it to 100, the object is removed from the scene:
107107

0 commit comments

Comments
 (0)