A behavior variable is visible everywhere outside its own graph today: in the inspector and Variables tab of every placed object (with an override each), and in the + Property menu of a Properties node of type Behavior. Counters, timers and scratch values clutter all of those.
What to build
A switch Private per variable on the behavior asset, next to Keep. Off by default, so existing projects stay as they are.
Placed object: a private variable is not shown in the inspector nor in the object's Variables tab, not even its live value during a run. To see it, look into the graph.
Overrides: switching a variable to private drops every override of it on placed objects, in one undo step. A running game does not write a private value back into the scene either.
Properties (Behavior): a private variable is not offered in the + Property menu. A port that names it by hand still works, at edit time and in the run.
Inside the behavior nothing changes: Variables node, Keep, default on the asset, one value per instance.
Decided
Overrides are dropped when switching to private.
No live values in the object's inspector; look into the graph.
Name "Private", default off.
A behavior variable is visible everywhere outside its own graph today: in the inspector and Variables tab of every placed object (with an override each), and in the `+ Property` menu of a `Properties` node of type Behavior. Counters, timers and scratch values clutter all of those.
## What to build
- A switch **Private** per variable on the behavior asset, next to Keep. Off by default, so existing projects stay as they are.
- **Placed object:** a private variable is not shown in the inspector nor in the object's Variables tab, not even its live value during a run. To see it, look into the graph.
- **Overrides:** switching a variable to private drops every override of it on placed objects, in one undo step. A running game does not write a private value back into the scene either.
- **`Properties` (Behavior):** a private variable is not offered in the `+ Property` menu. A port that names it by hand still works, at edit time and in the run.
- Inside the behavior nothing changes: `Variables` node, Keep, default on the asset, one value per instance.
## Decided
1. Overrides are dropped when switching to private.
2. No live values in the object's inspector; look into the graph.
3. Name "Private", default off.
Done in e8b3ac0 (plus cf6565d: new variables start with Keep off).
Lock switch per behavior variable, next to Keep. Off by default, existing projects are unchanged.
A placed object shows no private variable, also not while the game runs.
Switching to private drops its overrides on all placed objects (one undo step).
A running game neither writes a private value back nor loses it on a project change.
+ Property does not offer private variables. A port that names one by hand still works without a warning.
The default value of a private variable is read-only in the asset inspector.
Keep is now a pin icon, so the list header has room for both switches.
Not done: the animation track picker still offers private variables.
Tests: ./check.sh 2711 tests, CHECK EXIT 0. e2e 1,19,20,21,56: 119 checks passed. New e2e module 56 (7 checks), unit file tests/core/private-variables.test.ts (5 tests). Counter-checks fail as expected.
Wiki: Behaviors, Development (1ebead5).
Done in e8b3ac0 (plus cf6565d: new variables start with Keep off).
- Lock switch per behavior variable, next to Keep. Off by default, existing projects are unchanged.
- A placed object shows no private variable, also not while the game runs.
- Switching to private drops its overrides on all placed objects (one undo step).
- A running game neither writes a private value back nor loses it on a project change.
- `+ Property` does not offer private variables. A port that names one by hand still works without a warning.
- The default value of a private variable is read-only in the asset inspector.
- Keep is now a pin icon, so the list header has room for both switches.
Not done: the animation track picker still offers private variables.
Tests: `./check.sh` 2711 tests, CHECK EXIT 0. e2e 1,19,20,21,56: 119 checks passed. New e2e module 56 (7 checks), unit file `tests/core/private-variables.test.ts` (5 tests). Counter-checks fail as expected.
Wiki: Behaviors, Development (1ebead5).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
A behavior variable is visible everywhere outside its own graph today: in the inspector and Variables tab of every placed object (with an override each), and in the
+ Propertymenu of aPropertiesnode of type Behavior. Counters, timers and scratch values clutter all of those.What to build
Properties(Behavior): a private variable is not offered in the+ Propertymenu. A port that names it by hand still works, at edit time and in the run.Variablesnode, Keep, default on the asset, one value per instance.Decided
Done in
e8b3ac0(pluscf6565d: new variables start with Keep off).+ Propertydoes not offer private variables. A port that names one by hand still works without a warning.Not done: the animation track picker still offers private variables.
Tests:
./check.sh2711 tests, CHECK EXIT 0. e2e 1,19,20,21,56: 119 checks passed. New e2e module 56 (7 checks), unit filetests/core/private-variables.test.ts(5 tests). Counter-checks fail as expected.Wiki: Behaviors, Development (1ebead5).