MU (Movable Unit) represents physical objects that move through automation systems as products, parts, or assemblies. More...

Public Member Functions | |
void | PlaceMUOnTopOfPosition (Vector3 position) |
Places the MU with its bottom on top of the defined position. | |
void | LoadMu (MU mu) |
Load the named MU on this mu. | |
void | EventMUEnterSensor (Sensor sensor) |
Event that this called when MU enters sensor. | |
void | EventMUExitSensor (Sensor sensor) |
Event that this called when MU enters sensor. | |
void | EventMuLoad () |
Event that this MU is loaded onto another. | |
void | EventMUUnLoad () |
Event that this MU is unloaded from another. | |
void | InitMu (string muname, int localid, int globalid) |
void | EventMuEnterPathSimulation () |
Event that this MU is on Path. | |
void | EventMUExitPathSimulation () |
Event that this MU is unloaded from Path. | |
void | Fix (GameObject fixto) |
void | Unfix () |
Public method for unfixing MU to a gameobject, parent changes are done based on parent before fix. | |
void | PhysicsOff () |
Public method for turning Physics off. | |
void | PhysicsOn () |
Public method for turning Physics on. | |
void | UnloadOneMu (MU mu) |
Unloads one of the MUs which are loaded on this MU. | |
void | UnloadAllMUs () |
Unloads all of the MUs which are loaded on this MU. | |
void | Dissolve (float duration) |
Slowly dissolves MU and destroys it. | |
void | Appear (float duration) |
void | FixedUpdate () |
![]() | |
void | PreStartSim () |
Is called by the realvirtualController before the component is started. | |
void | StartSim () |
Is called by the realvirtualController to start or stop the component. | |
void | StopSim () |
Vector3 | DirectionToVector (DIRECTION direction) |
Transfers the direction enumeration to a vector. | |
DIRECTION | VectorToDirection (bool torotatoin, Vector3 vector) |
Transfers a vector to the direction enumeration. | |
float | GetLocalScale (Transform thetransform, DIRECTION direction) |
List< BehaviorInterfaceConnection > | UpdateConnectionInfo () |
List< Signal > | GetConnectedSignals () |
void | SetVisibility (bool visibility) |
Sets the visibility of this object including all subobjects. | |
List< BehaviorInterfaceConnection > | GetConnections () |
List< Signal > | GetSignals () |
GameObject | GetChildByName (string name) |
Gets a child by name. | |
List< GameObject > | GetChildsByName (string name) |
Gets all child by name. | |
GameObject | GetChildByNameAlsoHidden (string name) |
List< GameObject > | GetAllMeshesWithGroup (string group) |
List< GameObject > | GetAllWithGroup (string group) |
List< GameObject > | GetAllWithGroups (List< string > groups) |
List< GameObject > | GetAllMeshesWithGroups (List< string > groups) |
List< string > | GetMyGroups () |
List< GameObject > | GetMeshesWithSameGroups () |
List< GameObject > | GetAllWithSameGroups () |
MeshRenderer | GetMeshRenderer () |
Gets the mesh renderers in the childrens. | |
void | SetCollider (bool enabled) |
sets the collider in all child objects | |
void | ErrorMessage (string message) |
Displays an error message. | |
void | ChangeConnectionMode (bool isconnected) |
void | Log (string message) |
Logs a message. | |
void | Log (string message, object obj) |
Logs a message with a relation to an object. | |
void | Warning (string message, object obj) |
Logs a warinng with a relation to an object. | |
void | Error (string message, object obj) |
Logs an error with a relation to an object. | |
void | Error (string message) |
Logs an error. | |
GameObject | DebugPosition (string debugname, Vector3 position, Quaternion quaternation, float scale) |
Displays a gizmo for debugging positions. | |
void | SetFreezePosition (bool enabled) |
Freezes all child components to the current poosition. | |
void | SetRbConstraints (RigidbodyConstraints constraints) |
virtual void | AwakeAlsoDeactivated () |
Public Attributes | |
int | ID |
ID of this MU (increases on each creation on the MU source. | |
int | GlobalID |
Global ID, increases for each MU independent on the source. | |
List< GameObject > | MUAppearences |
List of MU appearances for PartChanger. | |
GameObject | FixedBy |
Current Gripper which is picking the part. | |
GameObject | LastFixedBy |
Last Gripper which has been picking the part. | |
GameObject | LoadedOn |
Current Part the MU is loaded on. | |
GameObject | StandardParent |
The standard parent Gameobject of the MU. | |
GameObject | ParentBeforeFix |
The parent of the MU before the last Grip. | |
List< Sensor > | CollidedWithSensors |
The current Sensors the Part is colliding with. | |
List< MU > | LoadedMus |
List of MUs which are loaded on this MU. | |
Source | CreatedBy |
Source which created this MU. | |
float | SurfaceAlignSmoothment |
Smoothing factor for surface alignment. | |
bool | UnfixSpeedInterpolate |
When unfixing an MU the interpolated speed of the kinematic Rigidbody will be transferred to the MU. | |
int | NumInterpolations |
Number of interpolations - specially needed when speed is not constant like when connected to external robot controllers. | |
float | FixerLastDistance |
Last distance to fixer in millimeters. | |
Rigidbody | Rigidbody |
List< TransportSurface > | AlignWithSurface |
List< TransportSurface > | TransportSurfaces |
float | DissolveDuration |
Duration in seconds for dissolve effect. | |
float | MaxDissolveValue |
Maximum dissolve shader value. | |
float | Velocity |
Current velocity in millimeters per second. | |
Game4AutomationEventMUDelete | EventMUDeleted |
Event is called when MU is Deleted / Destroyed. | |
Game4AutomationEventMU | EventMUIsLoaded |
Event is called when MU is loaded onto another. | |
Game4AutomationEventMU | EventMUGetsLoad |
Event is called when MU gets a MU loaded onto itself. | |
Game4AutomationEventMUSensor | EventMUSensor |
Event is called when MU collides with a Sensor. | |
Game4AutomationEventMUFix | EventMUFix |
Event is called when MU is fixed or unfixed. | |
![]() | |
string | Name |
The name of the component if it should be different from the GameObject name. | |
ActiveOnly | Active |
GameObject | FromTemplate |
realvirtualController | realvirtualController |
bool | HideNonG44Components |
bool | SceneIsAdditive |
bool | ForceStop |
Additional Inherited Members | |
![]() | |
enum | ActiveOnly { Always , Connected , Disconnected , Never , DontChange } |
![]() | |
static bool | DirectionIsLinear (DIRECTION direction) |
Gets back if the direction is linear or a rotation. | |
![]() | |
bool | hidename () |
bool | hideactiveonly () |
virtual void | OnStopSim () |
virtual void | OnPreStartSim () |
virtual void | OnStartSim () |
MU | GetTopOfMu (GameObject obj) |
Gets the top of an MU component (the first MU script going up in the hierarchy) | |
void | InitGame4Automation () |
Initialiates the components and gets the reference to the realvirtualController in the scene. | |
virtual void | AfterAwake () |
void | Awake () |
Detailed Description
MU (Movable Unit) represents physical objects that move through automation systems as products, parts, or assemblies.
The MU is the central component in realvirtual for representing any movable object in the automation simulation. It can be anything from raw materials, work-in-progress items, finished products, containers, pallets, or any other object that needs to be transported, processed, or handled within the automation system.
Key Features:
- Physics-based movement with automatic Rigidbody configuration
- Seamless transport on conveyor belts and other transport surfaces
- Can be gripped, fixed, and released by robots and handling devices
- Hierarchical loading system (MUs can be loaded onto other MUs, like parts on pallets)
- Unique identification with both local and global IDs for tracking
- Collision detection and sensor interaction
- Multiple visual appearances support for product variants
- Automatic alignment to transport surfaces with configurable smoothing
- Speed interpolation for smooth transitions when released from grippers
- Full lifecycle management from creation at sources to destruction at sinks
Transport and Handling:
- Automatically moves on TransportSurface components based on surface speed and direction
- Can be fixed to grippers and other handling devices while maintaining parent-child relationships
- Supports complex material flow with multiple transport surfaces simultaneously
- Maintains velocity information for smooth transitions between transport elements
Common Applications:
- Products on assembly lines
- Boxes and packages in logistics systems
- Pallets in warehouse automation
- Parts in manufacturing processes
- Containers in filling and packaging lines
- Workpiece carriers in production systems
- AGV-transported goods
Integration Points:
- Sources: Created by Source components with configurable intervals
- Sinks: Destroyed by Sink components at process endpoints
- Sensors: Detected by Sensor components for position tracking
- Grippers: Can be picked and placed by Grip and Fixer components
- Transport: Moved by TransportSurface and TransportGuided components
- PLCs: Tracked and controlled through various signal interfaces
Performance Optimization:
- Rigidbody sleep mode for stationary MUs
- Efficient collision layer management
- Optimized parent-child relationship handling
- Smart surface alignment algorithms
Events and Tracking:
- EventMUSensor: Triggered when entering/exiting sensor areas
- EventMUDelete: Triggered when MU is destroyed
- EventMUFix: Triggered when MU is fixed or unfixed
- Full tracking of creation source, current fixtures, and transport surfaces
For detailed documentation see: https://doc.realvirtual.io/components-and-scripts/mu-movable-unit
Member Function Documentation
◆ Dissolve()
void realvirtual.MU.Dissolve | ( | float | duration | ) |
Slowly dissolves MU and destroys it.
◆ EventMuEnterPathSimulation()
void realvirtual.MU.EventMuEnterPathSimulation | ( | ) |
Event that this MU is on Path.
◆ EventMUEnterSensor()
void realvirtual.MU.EventMUEnterSensor | ( | Sensor | sensor | ) |
Event that this called when MU enters sensor.
◆ EventMUExitPathSimulation()
void realvirtual.MU.EventMUExitPathSimulation | ( | ) |
Event that this MU is unloaded from Path.
◆ EventMUExitSensor()
void realvirtual.MU.EventMUExitSensor | ( | Sensor | sensor | ) |
Event that this called when MU enters sensor.
◆ EventMuLoad()
void realvirtual.MU.EventMuLoad | ( | ) |
Event that this MU is loaded onto another.
◆ EventMUUnLoad()
void realvirtual.MU.EventMUUnLoad | ( | ) |
Event that this MU is unloaded from another.
◆ LoadMu()
void realvirtual.MU.LoadMu | ( | MU | mu | ) |
Load the named MU on this mu.
◆ PhysicsOff()
void realvirtual.MU.PhysicsOff | ( | ) |
Public method for turning Physics off.
◆ PhysicsOn()
void realvirtual.MU.PhysicsOn | ( | ) |
Public method for turning Physics on.
◆ PlaceMUOnTopOfPosition()
void realvirtual.MU.PlaceMUOnTopOfPosition | ( | Vector3 | position | ) |
Places the MU with its bottom on top of the defined position.
◆ Unfix()
void realvirtual.MU.Unfix | ( | ) |
Public method for unfixing MU to a gameobject, parent changes are done based on parent before fix.
◆ UnloadAllMUs()
void realvirtual.MU.UnloadAllMUs | ( | ) |
Unloads all of the MUs which are loaded on this MU.
◆ UnloadOneMu()
void realvirtual.MU.UnloadOneMu | ( | MU | mu | ) |
Unloads one of the MUs which are loaded on this MU.
Member Data Documentation
◆ CollidedWithSensors
List<Sensor> realvirtual.MU.CollidedWithSensors |
The current Sensors the Part is colliding with.
◆ CreatedBy
Source realvirtual.MU.CreatedBy |
Source which created this MU.
◆ DissolveDuration
float realvirtual.MU.DissolveDuration |
Duration in seconds for dissolve effect.
◆ EventMUDeleted
Game4AutomationEventMUDelete realvirtual.MU.EventMUDeleted |
Event is called when MU is Deleted / Destroyed.
◆ EventMUFix
Game4AutomationEventMUFix realvirtual.MU.EventMUFix |
Event is called when MU is fixed or unfixed.
◆ EventMUGetsLoad
Game4AutomationEventMU realvirtual.MU.EventMUGetsLoad |
Event is called when MU gets a MU loaded onto itself.
◆ EventMUIsLoaded
Game4AutomationEventMU realvirtual.MU.EventMUIsLoaded |
Event is called when MU is loaded onto another.
◆ EventMUSensor
Game4AutomationEventMUSensor realvirtual.MU.EventMUSensor |
Event is called when MU collides with a Sensor.
◆ FixedBy
GameObject realvirtual.MU.FixedBy |
Current Gripper which is picking the part.
◆ FixerLastDistance
float realvirtual.MU.FixerLastDistance |
Last distance to fixer in millimeters.
◆ GlobalID
int realvirtual.MU.GlobalID |
Global ID, increases for each MU independent on the source.
◆ ID
int realvirtual.MU.ID |
ID of this MU (increases on each creation on the MU source.
◆ LastFixedBy
GameObject realvirtual.MU.LastFixedBy |
Last Gripper which has been picking the part.
◆ LoadedMus
List<MU> realvirtual.MU.LoadedMus |
List of MUs which are loaded on this MU.
◆ LoadedOn
GameObject realvirtual.MU.LoadedOn |
Current Part the MU is loaded on.
◆ MaxDissolveValue
float realvirtual.MU.MaxDissolveValue |
Maximum dissolve shader value.
◆ MUAppearences
List<GameObject> realvirtual.MU.MUAppearences |
List of MU appearances for PartChanger.
◆ NumInterpolations
int realvirtual.MU.NumInterpolations |
Number of interpolations - specially needed when speed is not constant like when connected to external robot controllers.
◆ ParentBeforeFix
GameObject realvirtual.MU.ParentBeforeFix |
The parent of the MU before the last Grip.
◆ StandardParent
GameObject realvirtual.MU.StandardParent |
The standard parent Gameobject of the MU.
◆ SurfaceAlignSmoothment
float realvirtual.MU.SurfaceAlignSmoothment |
Smoothing factor for surface alignment.
◆ UnfixSpeedInterpolate
bool realvirtual.MU.UnfixSpeedInterpolate |
When unfixing an MU the interpolated speed of the kinematic Rigidbody will be transferred to the MU.
◆ Velocity
float realvirtual.MU.Velocity |
Current velocity in millimeters per second.