Some of the most-asked questions in the community are secretly the same question. How do I make the score stop when I lose? How do I make a pickup come back? How do I hide the boss until the player is ready? The answer to all three is the Set Active block: it switches any object off — invisible, frozen, scripts stopped — and back on again, resuming exactly where it was.
The block
Set Active has two fields:
| Field | What it does |
|---|---|
| object | Leave empty for this object, or type a name to affect every object with that name |
| active | false switches off, true switches back on |
Switched off means all three at once: the object disappears, its physics freezes (nothing collides with it, nothing moves it), and its scripts stop running. Switched back on, it resumes at the same spot with the same values — nothing is lost.
Pattern 1: The score that stops when you lose
The classic question. Your player dies, but coins keep spawning and sensors keep counting, so the score keeps climbing over the game over screen.
On the player's death chain, before showing game over:
- Set Activeobject spawner, active false
- Set Activeobject coin, active false
Because the name field hits every object with that name, two blocks silence the whole system — every spawner, every coin already falling. The old way was a gameover variable checked in front of every scoring chain; if you've built that before, this replaces all of it.
Pattern 2: The pickup that comes back
Beginners reach for Destroy Object on pickups, then discover destroyed things are gone for good. Deactivating instead makes respawning trivial. The gem in the example project works like this:
- On Collision Enterobject player — fires once, on contact
- Set Variablescore → Expression solver →
score + 1 - Set Activeobject empty, active false — the gem switches itself off
And one respawner object (an Empty with a small collider) that stays awake:
- When Object Loads
- Repeat (Timer)seconds 2
- Set Active, on the timer's async portobject gem, active true
Every two seconds, every collected gem pops back — same spot, no Create Object, no cleanup. Reactivating a gem that's already active does nothing, so the pulse is harmless.
Pattern 3: The boss that appears when you're ready
The ghost in the example starts switched off and wakes at five gems. A controller object (an Empty, no components needed) runs two chains:
- When Object Loads → Set Activeobject boss, active false. The scene starts with the boss asleep — placed in the editor wherever it should appear, but invisible and harmless.
- On Play → If (True/False)expression
score == 5→ Set Active, object boss, active true. The moment the fifth gem lands, the ghost materialises and starts hunting.
Use == rather than > when the wake-up should happen once. On Play runs every frame, so score > 4 stays true for the rest of the game and re-runs the branch on every single frame. Set Active itself shrugs that off — switching on an object that is already on does nothing — but anything else you hang off the same branch (a sound, a message, a score bonus) will fire hundreds of times. == 5 is true on the one frame the fifth gem lands, and never again.
This is the pattern for anything staged: waves, cutscene props, doors that unlock, second phases. Build everything in the editor where it belongs, switch it off at load, wake it when the moment comes.
Pattern 4: The start menu that gets out of the way
A menu is just objects you switch off. Ghost Gems opens with three of them — a title, a line of instructions and a PLAY button — sitting over the running game. The button carries a Box Collider so it can be tapped, and one chain does all of it:
- When Object Touched → Set Variablescore to
0, so a second run starts clean. - Set Activeobject introTitle, active false — then the same block again for introHint.
- Set Activeobject field left empty, active false. The button switches itself off. An empty object field always means "the object running this script".
No scene to load, no separate menu screen. The game was already running underneath — the menu simply stopped covering it. The same three blocks in reverse give you a pause menu, a game-over card or a level-complete popup.
Set Active or Destroy Object?
| Set Active false | Destroy Object | |
|---|---|---|
| Comes back? | Yes — Set Active true, same spot, same values | No — only Create Object can make a new copy |
| Good for | Pickups, bosses, pausing systems, anything staged | Bullets, defeated enemies, one-shot effects |
| Cost | Object still exists, just idle | Gone completely |
Rule of thumb: if it can ever return, deactivate it. If it's genuinely finished — a bullet that hit, an enemy that died for good — destroy it.
When it doesn't behave
| Symptom | Cause |
|---|---|
| Paused object never comes back | Its own script was supposed to wake it — it can't. Move the wake-up chain to another object. |
| Set Active did nothing | Name typo in the object field — it must match the target's name exactly |
| Wrong things vanished | The name field affects every object with that name — rename the ones you want treated differently |
| Boss visible for a flash at scene start | The controller pauses it a moment after load — start the boss off-screen and let placement hide the flash |
| Reactivated object sits still | Its speed came from a one-time event. Give it an On Play movement chain, or have the waker also set its velocity |
Try it: Ghost Gems
The example project uses Set Active eight times across fourteen objects: a start menu that hides itself, two self-deactivating gems, a respawner pulsing them back by name, and a controller that hides the ghost at load and wakes it at five gems. Slide with the left and right halves of the screen, grab gems, and see how long you last once the ghost is loose.
It explains itself while you play — a caption under the score says what Set Active just did, each time it fires — and every use of the block in the scripts has a note sitting next to it. Build it yourself in about ten minutes, or open the scripts and read the four patterns wired up. Every object is plain: nothing you can't edit, rename or delete.
Download GhostGemsExample.zip (5 KB)
Quicker still: open Max2D, go to Projects, and tap Ghost Gems under Starter games — it lands in your project list in one tap. To use the download instead: Projects → Import Project → pick the zip. Needs the newest app version — on older versions the Set Active blocks are skipped.
Frequently asked questions
How do I make my score stop when I lose?
On the death chain, Set Active false at whatever keeps scoring — the spawner, the coins, the sensors. Deactivated objects can't count, spawn or collide, so the score freezes with the game.
Set Active or Destroy Object?
Destroy is forever; Set Active is a switch. If the object can ever come back — pickups, bosses, level pieces — deactivate it. If it's finished for good, destroy it.
Why won't my paused object wake itself?
Pausing stops its scripts, including the one that would have woken it. Keep one object awake — a controller or timer — and let it do the waking.
Can I pause everything at once, like a pause menu?
You can pause whole systems by name — all enemies, all spawners — with one block each. A true whole-game pause button is a different feature; for now, pausing the few object names that move is the practical route.
One block, three patterns, endless uses
Update Max2D and try Set Active tonight. Free on Google Play.