Create Prefab (Pro)
Introduction
While Unity provides a standard prefab workflow, realvirtual goes a step further with its own Create Prefab function. This tool is designed specifically for industrial simulation workflows, allowing you to generate self-contained, reusable assets that include not only meshes and hierarchy but also the logic components that define behavior—such as drives, signals, sensors, and automation interfaces.
💡 Hint: You should typically use this function after preparing and optimizing your GameObject—for example, after using Combine Meshes—to turn it into a lightweight, modular component.
Overview
The Create Prefab
function in realvirtual creates a prefab asset that includes:
The complete GameObject hierarchy
All associated meshes (combined or separate)
All attached realvirtual components, such as:
Drives
Signals
Sensors
Kinematic groups
Custom logic or automation interfaces
This ensures the prefab is fully portable and ready for use in any simulation context built with realvirtual.
Scene Mesh Handling
Unlike Unity’s standard workflow, realvirtual's Create Prefab
works seamlessly even when:
Meshes are still embedded in the scene, for example after a CADLink import
Meshes have been combined using the Combine Meshes utility
It acts similarly to an FBX export, but instead of creating an external file, it generates a single prefab containing all geometry, hierarchy, and logic in one asset—ready for reuse and versioning in your simulation workflows.
When to Use
After optimizing an imported CAD structure
When creating reusable standard components
When preparing modular assets for parts libraries or versioned assets
Before exporting or distributing simulation-ready components
How to Use
Select the root GameObject Choose the GameObject that includes all child objects and components you want to include in the prefab.
Run Create Prefab Right-click on the selection in the Hierarchy and choose:
realvirtual/Create Prefab
Result The prefab will be automatically created under the
Assets/
folder of your project.
Organize If needed, manually move the prefab to your desired location within the Unity project (e.g.,
Assets/Prefabs/[ExportedPrefab]
).
📦 The resulting
.prefab
file contains the full structure, geometry, and behavior. It’s fully reusable across scenes and projects and supports realvirtual's simulation features out of the box.
Last updated