Edit Mode
Edit Mode is the most powerful AI Assistant mode and enables AI-driven modifications to your Mattercraft project. It can propose changes to scenes, scripts, components, and project configuration that you can accept or reject individually.
- Open AI Assistant panel
- Select Edit Mode
- Describe desired changes in natural language
- Review proposed modifications
- Accept or reject changes individually or as a group
You can also upload images or code snippets into the prompt input to help give more context to your edit request.
Change Review Process
Section titled “Change Review Process”Changes are displayed with a pencil icon across the Mattercraft editor.
Each change can be:
- Accepted: Applied to your project immediately
- Rejected: Discarded without affecting project
- Modified: Edited before accepted (manual intervention required and will be classed as a proposed change until accepted)
Query Types
Section titled “Query Types”Scene Modifications
Section titled “Scene Modifications”"Add a rotation animation to the cube that plays when clicked"
"Create a particle system for the fire effect"
"Make the robot character dance when the experience starts"
Component Creation
Section titled “Component Creation”"Create a custom dancefloor component with animated tiles"
"Make a cyberpunk shader for the drink can"
"Build a UI button component with hover effects"
Code Generation
Section titled “Code Generation”"Write a script that tracks user interactions"
"Create a component that loads 3D models dynamically"
"Generate a custom material with animated properties"
Implementation Process
Section titled “Implementation Process”Edit Mode follows this workflow:
- Project Analysis: Examines current project state
- Dependency Check: Verifies required components/behaviors
- Code Generation: Creates necessary scripts and components
- Scene Integration: Adds components to scene hierarchy
- Configuration: Sets appropriate properties and parameters
- Validation: Checks for TypeScript errors and conflicts
Generated Code Quality
Section titled “Generated Code Quality”Edit Mode produces:
- Type-safe TypeScript: Full type annotations and proper interfaces
- Documented code: Comments explaining functionality
- Configurable components: Exposed properties for UI editing
- Performance-optimized: Efficient algorithms and resource usage
- Standard-compliant: Follows Mattercraft coding conventions
Best Practices
Section titled “Best Practices”Queries
Section titled “Queries”- Be specific about desired functionality
- Mention performance requirements if applicable
- Specify UI requirements for generated components
- Include context about existing project structure
Change Management
Section titled “Change Management”- Review all proposed changes before accepting
- Test functionality after applying modifications
- Use commit history for important changes
Example Prompts
Section titled “Example Prompts”Animation Creation
Section titled “Animation Creation”Input: Make an animation that spins the hat and play it when the user taps on the hat
Process:
- Analyzes scene structure to locate hat object
- Creates new animation layer and timeline
- Adds rotation keyframes with appropriate easing
- Configures PlayLayerClip behavior for click interaction
- Applies changes to scene file
Custom Component
Section titled “Custom Component”Input: Create a custom component that's a dancefloor
Process:
- Creates new TypeScript file with component template
- Implements procedural geometry generation
- Adds animation system for tile effects
- Exposes configurable properties (size, colors, speed)
- Integrates component into scene hierarchy
Shader Development
Section titled “Shader Development”Input: Make a custom shader that's a cyberpunk vibe for this drink's can
Process:
- Analyzes target object materials
- Creates GLSL vertex and fragment shaders
- Implements cyberpunk visual effects (neon, glitch, etc.)
- Adds configurable properties for customization
- Applies shader to target object