Insert Password Component
The Insert Password component allows you to create secure password-protected interactions in your Hyperfy scene. Think of it as a digital lock that can control access to content, trigger events, or unlock hidden features when players enter the correct password. It works across all connected players, so password validation and UI state are synchronized for everyone.
Important: This component creates a password input UI that appears when triggered and validates user input against a master password. It can emit events on success/failure and control other components through the event system.
What Does It Do?
The Insert Password component is like having a digital security system for your 3D world. You can:
- Create password-protected areas that require specific codes to access
- Show/hide password UI when players interact with triggers or buttons
- Validate passwords against a master password you set
- Emit events when passwords are correct or incorrect
- Sync UI state so all players see the same password interface
- Chain actions by triggering other components when passwords are validated
- Add delays for timed password reveals or effects
Important: This component creates a floating password input interface that appears when activated. Players type passwords using their keyboard, and the component validates them against your master password. For the best experience, combine this with other components that trigger the password UI.
Video Demo
Watch the Insert Password component in action: password UI appearing, text input, validation, and synchronized effects across all players.
Properties
Basic Settings
| Property | Type | Default | Description |
|---|---|---|---|
App ID | text | Auto | Unique name for this component (auto-generated) |
Node Name | text | "" | Required: Name of the 3D object in your scene |
Debug Logs | toggle | false | Show detailed information for troubleshooting |
Add Collision | toggle | true | Make the object solid (players can't walk through) |
Start Visible | toggle | true | Should the object be visible when the scene loads? |
Password Manager Settings
| Property | Type | Default | Description |
|---|---|---|---|
Sync Changes | toggle | false | Should all players see password UI changes at the same time? |
Designer Mode | toggle | false | Show password input UI in designer mode for testing |
Use Delay | toggle | false | Add a wait time before applying UI state changes? |
Delay (sec) | number | 0 | How many seconds to wait before instant change (0.1 to 60) |
Master Password | text | "" | Required: The password that will be validated against user input |
UI Title | text | "" | Title displayed in the password manager UI |
Event Listeners | textarea | [] | List of events that trigger password UI changes |
When password success | switch | Block & Close UI | What happens after successful password validation |
Password Success Options
| Option | Description |
|---|---|
Close UI | Simply close the password interface |
Block UI | Keep UI open but prevent further password attempts |
Block & Close UI | Block future attempts and close the interface |
How Events Work
The Insert Password component listens for "signals" (events) from other components. When it receives a signal, it can show/hide the password UI or perform other actions. The component uses its unique App ID (generated by Hyperfy) to identify itself in the event system.
Event Format
In the Event Listeners field, you can specify events like this:
[
{
"id": "a1b2c3d4e",
"actions": [
{
"type": "set-visibility",
"params": {
"isActive": true,
"isSync": true,
"delay": 1.5
}
}
]
}
]
Note: When referencing this component in events from other components, use the App ID that Hyperfy generated for this component. Also, when duplicating components, be sure you make the app unique, so it has a new AppID.
Event Parameters
When an event triggers a password UI change, you can control:
| Parameter | Type | Description |
|---|---|---|
isActive | boolean | true = show password UI, false = hide password UI |
isSync | boolean | true = all players see change, false = local only |
delay | number | Seconds to wait before applying the change |
Emitted Events
The component automatically emits these events when passwords are validated:
| Event | Description | Payload |
|---|---|---|
password-valid-<appID> | Emitted when correct password is entered | { userId, timestamp } |
password-invalid-<appID> | Emitted when incorrect password is entered | { userId, timestamp } |
Common Use Cases
1. Secret Door Access
- Object: A hidden door or portal
- Event: Player touches a trigger
- Action: Password UI appears, player enters code, door unlocks on success
2. Treasure Chest Protection
- Object: A valuable item container
- Event: Player interacts with chest
- Action: Password UI shows, correct password reveals treasure
3. Admin Panel Access
- Object: A control panel or admin interface
- Event: Player clicks on panel
- Action: Password UI appears, admin features unlock on success
4. Timed Password Reveals
- Object: A hidden message or item
- Event: Timer reaches zero
- Action: Password UI appears after delay, player enters code to reveal content
5. Multiplayer Synchronization
- Object: A shared puzzle element
- Event: Any player triggers the puzzle
- Action: Password UI appears for all players, synchronized validation
Step-by-Step Setup
1. Add the Component
- Drag the Insert Password component into your scene
- Select the 3D object you want to associate with the password system
2. Configure Basic Settings
- Set the
Node Nameto match your 3D object's name - Choose if the object should
Start Visible - Decide if it should
Add Collision(be solid)
3. Set Up Password System
- Enter your
Master Password(the code players need to know) - Set a
UI Titlefor the password interface - Choose what happens
When password success
4. Configure Events
- In
Event Listeners, add the events that should trigger the password UI - Use the JSON format shown above
- Replace event names with actual events from other components
5. Set Up Behavior
- Enable
Sync Changesif all players should see password UI changes - Set
Use DelayandDelay (sec)for timed reveals - Enable
Designer Modefor testing during development
6. Test Your Setup
- Enable
Debug Logsto see what's happening - Trigger your events and watch the password UI appear
- Test password validation with correct and incorrect codes
- Check that all players see the same interface
Tips for Designers
Choosing Good Passwords
- Use memorable but secure passwords
- Consider the theme of your world (e.g., "Dragon2024" for fantasy)
- Avoid overly complex codes that players might forget
- Test passwords with friends to ensure they're reasonable
Planning Your Password System
- Think about when players should see the password UI
- Consider timing and delays for dramatic reveals
- Plan for both single-player and multiplayer scenarios
- Design clear visual cues for password-protected areas
Testing Your Setup
- Always test with multiple players
- Use debug logs to troubleshoot issues
- Test edge cases (what happens if players disconnect?)
- Verify password validation works correctly
Performance Considerations
- Don't show password UI too frequently
- Remember that the UI appears as a floating interface
- Consider the impact on mobile devices
- Test with different screen sizes
Troubleshooting
Password UI Doesn't Appear
- Check that your events are being sent correctly
- Verify that the
Event Listenersformat is correct - Enable
Debug Logsto see what's happening - Test with
Designer Modeenabled
Password Validation Not Working
- Ensure
Master Passwordis set correctly - Check that the password field isn't empty
- Verify the password matches exactly (case-sensitive)
- Use debug logs to see validation attempts
Changes Not Syncing
- Make sure
Sync Changesis enabled - Check that the event includes
"isSync": true - Verify all players are connected
- Test with simple events first
Delays Not Working
- Ensure
Use Delayis enabled - Check that
Delay (sec)is greater than 0 - Verify the delay value in your event parameters
- Remember: delays only postpone the instant change
UI Not Closing After Success
- Check the
When password successsetting - Verify that the success event is being emitted
- Use debug logs to see what's happening
- Test with different success options
Best Practices
- Start Simple: Test with basic password validation before adding complexity
- Use Clear Passwords: Make your master password memorable but secure
- Plan for Multiplayer: Consider how password UI affects all players
- Add Delays: Use delays for smoother, more professional experiences
- Test Thoroughly: Always test with multiple players and scenarios
- Use Debug Logs: Enable debug mode during development
- Document Your Setup: Keep notes on your password and event configurations
- Design Clear Triggers: Make it obvious when players should see the password UI
- Consider Accessibility: Ensure password UI is visible and usable for all players
Security Considerations
- Player Experience: Balance security with usability
- Testing: Always test password validation thoroughly
- Documentation: Keep passwords documented for testing purposes
- Updates: Consider changing passwords if they become compromised