Door And Unlock NUG
Overview
The Door And Unlock NUG controls player progression using requirements from other systems.
Use it for locked doors, gates, barriers, collectible checks, ability checks, power-up checks, and demo-level progression examples.
This system is currently documented around doors because doors are the clearest first example. Long term, the unlock logic should not be coupled to doors only. The same logic should also support jars, rocks, chests, reward containers, breakable objects, blocked paths, and any actor that can open, break, reveal, or change state after a requirement is met.
Current Components
BP_BaseDoorAC_DoorLock
Planned Component Rename
AC_DoorLock is the current working name, but it is too tightly tied to doors.
Planned future split:
AC_CollectibleUnlockAC_AbilityUnlock
This makes the system more modular. A door can use these components, but so can a jar, rock, gate, chest, shrine, hidden reward object, or level blocker.
What The System Does
- Checks whether a player meets unlock requirements
- Supports collectible requirements
- Supports optional collectible consumption
- Supports active ability or power-up requirements
- Supports action-based unlocks from power-ups
- Keeps unlock logic separate from the actor that opens, breaks, or reveals content
- Gives designers a clean place to configure progression rules
Quick Setup
Use this section to test one locked door.
- Add
AC_DoorLocktoBP_BaseDoor. - Add a collectible requirement.
- Assign the required collectible data asset or tag.
- Set the required amount.
- Add
AC_CollectibleWalletto the player. - Add enough collectibles to the level.
- Press Play.
- Try the door before collecting enough items.
- Collect the required amount.
- Try the door again.
Features
- Collectible requirements
- Optional consume-on-unlock behaviour
- Ability-based unlocking
- Active power-up checks
- Power-up action checks
- Reusable unlock logic
- Requirement information for UI
- Works beyond doors when refactored into unlock components
Unlock Examples
Collectible Unlock
A door needs 10 gems before it opens.
A chest needs one silver key before it reveals a reward.
A gate checks whether the player has enough tokens, but does not consume them.
Active Power-Up Unlock
A barrier only opens while the player has a temporary fire power-up active.
A magic gate only opens while the player is in a large form.
A timed shortcut only opens while a speed boost is active.
Power-Up Action Unlock
A cracked rock opens when the player uses a charge action.
A sealed jar breaks when hit by a fire action.
A heavy switch activates when the player uses a grow or ground-pound style power-up.
A frozen object melts when the player uses fire, revealing contents.
Runtime Flow
- Player interacts with, hits, overlaps, or affects an unlockable actor.
- The actor asks its unlock component to check requirements.
- Collectible requirements are checked against
AC_CollectibleWallet. - Ability requirements are checked against the player ability or power-up component.
- Action requirements check what the player has just done, such as charge, fire, shrink, grow, or another power-up action.
- If requirements pass, the actor runs its success behaviour.
- Success behaviour could open a door, break a jar, move a barrier, reveal contents, enable a path, or trigger a reward.
- If consume-on-unlock is enabled, the required collectible amount is removed.
- If requirements fail, the actor can show locked feedback or ignore the action.
Usage
For now, attach AC_DoorLock to a door actor and define the required unlock conditions.
Long term, use AC_CollectibleUnlock for currency, key, token, and item checks. Use AC_AbilityUnlock for active power-up checks and action-based unlocks.
The actor should own the result. The unlock component should only answer whether the player is allowed to unlock it.
Blueprint Tutorial
Goal
Create a door that opens only when the player has the required collectible amount, then extend the same pattern to ability or power-up checks.
Before You Start
Create or confirm these assets exist:
BP_BaseDoorAC_DoorLockAC_CollectibleWalletAC_AbilityComponent- A collectible data asset
- A player character with wallet and ability components
Step 1, Add The Door Lock Component
- Open
BP_BaseDoor. - Add
AC_DoorLockas an Actor Component. - Compile and save.
Step 2, Configure Collectible Requirements
- Select
AC_DoorLockin the Components panel. - Add a collectible requirement.
- Assign the collectible data asset or collectible tag.
- Set the required amount.
- Enable consume-on-unlock only if the door should spend the collectible.
Step 3, Configure Ability Or Power-Up Requirements
Use this when the actor should only unlock while the player has a certain power-up active.
- Add an ability requirement to the unlock component.
- Choose the required ability or power-up type.
- Choose whether the ability must be active, permanently unlocked, or triggered by an action.
- Use active checks for temporary states, such as fire active or speed boost active.
- Use action checks for direct player actions, such as charge, fire shot, ground pound, shrink, or grow.
Step 4, Add Interaction Or Action Logic
Inside BP_BaseDoor, or any unlockable actor, connect the event to the unlock check:
- Player interacts with the actor, overlaps it, or hits it with an action.
- Get the unlock component.
- Pass in the player actor.
- Pass in the action type if needed.
- Call the requirement check function.
- If true, run the actor success behaviour.
- If false, show locked feedback or do nothing.
Step 5, Add Success Behaviour
The actor decides what happens after the unlock succeeds.
Examples:
- Door opens
- Gate slides away
- Jar breaks
- Rock cracks open
- Chest reveals a reward
- Barrier disables collision
- Hidden collectible appears
Step 6, Test The Result
- Press Play with zero collectibles and no power-up active.
- Try the locked actor.
- Confirm it stays locked.
- Collect the required amount or activate the required power-up.
- Try again.
- Confirm the actor unlocks.
- Test action-based logic by using a power-up action, such as charge or fire.
- Confirm the actor only unlocks from the correct action.
- Test consume-on-unlock if enabled.
Photo Slots
Use these slots when adding screenshots to the documentation site.
Door Actor Setup
Image slot: door actor setup.
Unlock Component Settings
Image slot: unlock component settings.
Collectible Requirement Setup
Image slot: collectible unlock requirement setup.
Ability Requirement Setup
Image slot: ability or power-up unlock requirement setup.
Power-Up Action Unlock Test
Image slot: power-up action unlock test.
Runtime Locked Feedback
Image slot: runtime locked feedback.
Runtime Open Door Test
Image slot: runtime open door test.
Injected Blueprint Code Slots
Paste exported Unreal Blueprint node text into these blocks when the Blueprint is final.
BP_BaseDoor, Interact Event
Paste exported Blueprint node code here.
AC_DoorLock, Requirement Check Function
Paste exported Blueprint node code here.
Future AC_CollectibleUnlock, Requirement Check Function
Paste exported Blueprint node code here.
Future AC_AbilityUnlock, Requirement Check Function
Paste exported Blueprint node code here.
BP_BaseDoor, Open Door Function
Paste exported Blueprint node code here.
Unlockable Actor, Break Or Reveal Function
Paste exported Blueprint node code here.
Locked UI Feedback
Paste exported Blueprint node code here.
Common Issues
Door Opens Without Requirements
Check that the requirement array is not empty.
Also check that the door calls the requirement check before running its open, break, or reveal logic.
Door Never Opens
Check that the player has the required collectible amount.
Also check that the door and wallet are using the same collectible data asset or gameplay tag.
Collectibles Are Removed When They Should Not Be
Check the consume-on-unlock setting.
Disable it if the actor should only check the amount and not spend the collectible.
Door Does Not React To A Power-Up
Check that the ability or power-up state is active before the door checks requirements.
Also check that the required ability type matches the ability activated by the pickup.
Locked Feedback Does Not Appear
Check that the failed requirement path is connected to the UI or feedback logic.
Unlock Logic Is Too Door-Specific
Keep the unlock check inside the component and the result behaviour inside the actor.
The component should answer whether the player can unlock. The actor decides what happens next.
Refactor Plan
The current AC_DoorLock name should be treated as a temporary implementation name.
Long-term target:
AC_CollectibleUnlockhandles collectible, key, currency, and token checksAC_AbilityUnlockhandles active power-up checks and action-based ability checks- Doors, jars, rocks, chests, barriers, and other actors use these components without owning the requirement logic
- Each actor handles its own result, such as open, break, reveal, disable, move, or spawn reward
This reduces coupling and makes the toolkit easier to reuse across different platformer objects.
Extension Notes
- Add support for multiple requirement groups later
- Add OR logic if an actor can accept different unlock routes
- Add UI data output so the HUD can show missing requirements
- Add save support so unlocked actors stay open, broken, or revealed
- Add ability checks for charge, fire, swim, shrink, grow, speed boost, and other platformer states
- Add action source data so unlocks can tell the difference between interact, overlap, charge, fire, or melee
Testing Checklist
- Actor remains locked when collectible requirements are missing
- Actor unlocks when collectible requirements pass
- Consume-on-unlock removes the correct amount
- Check-only mode leaves the wallet value unchanged
- Actor remains locked when the required active power-up is missing
- Actor unlocks while the required active power-up is active
- Actor only unlocks from the correct action when action-based logic is enabled
- Locked feedback appears when the player fails the check
- Actor state can be saved later
- Requirements can be changed by a designer without editing core actor logic
- The same unlock logic can be reused on a door, jar, rock, chest, or barrier