Skip to content

Commit 1c640cb

Browse files
[Auto] [Improve] Enhanced variables docs with bject variable guidance, and physics2 fixes (#454)
1 parent 7a5e446 commit 1c640cb

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

automated_updates_data.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
{
2929
"date": "2026-02-16",
3030
"summary": "Improved bitmap text and shape painter documentation: added alignment properties, wrapping width, and comprehensive list of all shape types"
31+
},
32+
{
33+
"date": "2026-02-18",
34+
"summary": "Improved variables documentation: added array/structure manipulation operations, object variable use-case guidance, and fixed physics2 typos"
3135
}
3236
]
3337
}

docs/gdevelop5/all-features/variables/object-variables.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,17 @@ In the editor, choose "Add a variable", then enter a name, choose a data type an
3131
## Using object variables in expressions
3232

3333
You can use object variables in [expressions](/gdevelop5/all-features/expressions). Just write the name of the object, followed by a dot then the name of the variable to use it in a formula. For example: `Player.RemainingPoints`.
34+
35+
## When to use object variables
36+
37+
Object variables are the right choice when the data is **specific to one instance**. For example:
38+
39+
- An enemy's current health — each enemy on the screen needs its own value. While a variable can work, the [Health behavior](/gdevelop5/extensions/health/) is usually a better choice for managing health.
40+
- A projectile's damage — each projectile may carry a different power level depending on the weapon that fired it.
41+
- A collectible's point value — each coin or gem can hold a different reward.
42+
43+
If every instance always shares the same value, a [scene variable](/gdevelop5/all-features/variables/scene-variables) or a [global variable](/gdevelop5/all-features/variables/global-variables) is usually simpler.
44+
45+
!!! tip
46+
47+
Object variables can also hold structures or arrays, which lets you store complex per-instance data (for example, an inventory attached to a character object) without needing any additional variables.

docs/gdevelop5/behaviors/physics2/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The world has three properties:
3030

3131
* **Gravity**. It consists of two components (X and Y) and works like our gravity adding a force to every object, pushing them in the given direction. Objects support a gravity scale factor too, more on this in the bodies section.
3232
* **Timescale**. It defines the scale of time the simulation will use. With a timescale of `0.5`, the simulation will run at half the speed; with a timescale of `2`, the simulation will be twice as fast. If timescale is `0`, the simulation will pause. Super useful for bullet time effects!
33-
* **Scale**. GDevelop distances and sizes are defined in pixels, but the physics engine uses meters internally. A scale factor must is set (with two components, scale on X axis and on Y axis) to make the conversion. The scale numbers mean how many pixels a meter is; for example, a scale of 50 means that a distance of 50 pixels in GDevelop is converted to 1 meter in the physics world.
33+
* **Scale**. GDevelop distances and sizes are defined in pixels, but the physics engine uses meters internally. A scale factor must be set (with two components, scale on X axis and on Y axis) to make the conversion. The scale numbers mean how many pixels a meter is; for example, a scale of 50 means that a distance of 50 pixels in GDevelop is converted to 1 meter in the physics world.
3434

3535
!!! note
3636

@@ -42,7 +42,7 @@ Bodies are the life of the Physics extension; they define how your object will m
4242

4343
When you add the Physics behavior to an object, you can set the body configuration right from the IDE.
4444
There are many options to play with. They have been categorized below.
45-
.
45+
4646
### Body Type
4747

4848
GDevelop supports three basic body types:

0 commit comments

Comments
 (0)