Marker component for precise MU placement by a Grip component. More...
Public Member Functions | |
| void | SetOccupied (MU mu) |
| Sets the occupying MU and notifies the MU via EventMUPlacedOnTarget. | |
| void | ClearOccupied () |
| Clears the occupying MU and notifies the MU via EventMURemovedFromTarget. | |
Public Attributes | |
| bool | AlignPosition |
| If true the MU position is snapped to the GripTarget position. | |
| bool | AlignRotation |
| If true the MU rotation is aligned to the GripTarget rotation when placed. | |
| MU | OccupiedBy |
| Currently placed MU at this target position (null = free) | |
Properties | |
| bool | IsFree [get] |
| Returns true when no MU is currently occupying this target. | |
Detailed Description
Marker component for precise MU placement by a Grip component.
GripTarget is a lightweight marker that defines where MUs should be placed by a Grip. Place this component on a GameObject at the desired placement position and rotation. The Grip component automatically searches for the nearest free GripTarget within its GripTargetSearchRadius when Place() is called in Auto mode.
Key Features:
- Zero-configuration marker - position and rotation come from the Transform
- OccupiedBy tracking: knows which MU is currently placed here
- Automatic stale-reference cleanup when the occupying MU is destroyed
- Auto-creates a SphereCollider trigger in Reset() so OverlapSphere can detect it
- Thread-safe SetOccupied() prevents two Grips from racing for the same target
Common Applications:
- Fixture positions in CNC machines or assembly stations
- Precise placement slots on rotating tables or AGVs
- Pick-and-place output trays with defined positions
- Pallet loading positions for ordered stacking
Integration Points:
- Grip.PlaceMode = Auto with GripTargetSearchRadius > 0 automatically finds free targets
- When OccupiedBy is set, IsFree returns false and other Grips skip this target
- OccupiedBy is cleared automatically when the MU is destroyed or picked up
For detailed documentation see: https://doc.realvirtual.io/components-and-scripts/griptarget
Member Function Documentation
◆ ClearOccupied()
| void realvirtual.GripTarget.ClearOccupied | ( | ) |
Clears the occupying MU and notifies the MU via EventMURemovedFromTarget.
◆ SetOccupied()
| void realvirtual.GripTarget.SetOccupied | ( | MU | mu | ) |
Sets the occupying MU and notifies the MU via EventMUPlacedOnTarget.
Member Data Documentation
◆ AlignPosition
| bool realvirtual.GripTarget.AlignPosition |
If true the MU position is snapped to the GripTarget position.
◆ AlignRotation
| bool realvirtual.GripTarget.AlignRotation |
If true the MU rotation is aligned to the GripTarget rotation when placed.
◆ OccupiedBy
| MU realvirtual.GripTarget.OccupiedBy |
Currently placed MU at this target position (null = free)
Property Documentation
◆ IsFree
|
get |
Returns true when no MU is currently occupying this target.