Group Collision Checker (Pro)
Overview
Section titled “Overview”The GroupCollisionChecker detects runtime collisions between named realvirtual groups. Objects within the same group never collide with each other (self-collision is suppressed), while objects from different groups trigger collision events automatically.
This is useful for monitoring whether a robot arm collides with machine fixtures, or a gripper penetrates a workpiece holder — without false alarms from joints within the same kinematic chain.
Collision between the robot group and the machine door is detected and highlighted in real time
How It Works
Section titled “How It Works”The system uses a single dedicated physics layer (rvCollissionCheck) that is isolated from all other realvirtual layers (sensors, transport surfaces, sinks). Within that layer:
- Same-group collider pairs are suppressed via
Physics.IgnoreCollision - Cross-group collider pairs trigger collision events automatically
- Only one physics layer is consumed regardless of how many groups you define
This design avoids layer exhaustion and prevents side effects on sensors or transport systems.
Quick Start
Section titled “Quick Start”- Add a GroupCollisionChecker component to any GameObject in your scene
- Add entries to Collision Groups — each entry is a realvirtual Group name plus a collider mode
- Optionally assign a MultiObjectOverlayRendererFeature reference for GPU-based highlighting
- Press Play — collisions are detected and reported via signals, events, and Inspector status
Properties
Section titled “Properties”Collision Groups
Section titled “Collision Groups”Collision Groups (list) The groups to monitor. Each entry defines:
- Group Name — the realvirtual Group name (as assigned via the Group component)
- Collider Mode — how colliders are created for objects in this group:
- BoxApproximation — creates a BoxCollider from the renderer bounds. Fast and safe, but coarse.
- MeshCollider — creates a convex MeshCollider. More accurate, uses the convex hull (max 255 vertices).
- ExistingOnly — uses only already-present colliders. Objects without a collider are skipped.
Settings
Section titled “Settings”Auto Setup On Start (boolean) When enabled, the collision system initializes automatically when the simulation starts. Disable this to call SetupCollisionSystem() manually from script.
Highlight
Section titled “Highlight”Highlight On Collision (boolean) Enables GPU-accelerated visual highlighting of colliding objects via the URP Overlay Renderer Feature.
Overlay Feature (reference) Assign a dedicated MultiObjectOverlayRendererFeature instance from your URP Renderer Asset. This must be a separate instance from the one used by the Selection system.
Highlight Color (Color) The highlight overlay color applied to colliding objects. Default: red.
Overlay Mode (enum) The rendering style for the highlight: Default, XRay, or Blink.
Blink Speed (float) Blink frequency in cycles per second when Overlay Mode is set to Blink.
Reset Mode (enum) Controls when highlights are removed:
- WhileColliding — highlight disappears automatically when collision ends
- OnEnterPersistent — highlight stays until manually reset via the ResetHighlight signal
Interface Connection (PLC Signals)
Section titled “Interface Connection (PLC Signals)”CollisionActive (PLCInputBool) Output to PLC — true when at least one cross-group collision is active.
CollisionCount (PLCInputInt) Output to PLC — number of currently active collision pairs.
ResetHighlight (PLCOutputBool) Input from PLC — a rising edge clears all collision highlights.
ResetCollisions (PLCOutputBool) Input from PLC — a rising edge resets all collision tracking.
Events
Section titled “Events”OnCollisionEnterEvent (UnityEvent) Fired when a cross-group collision begins. Provides both GameObjects involved.
OnCollisionExitEvent (UnityEvent) Fired when a cross-group collision ends. Provides both GameObjects involved.
Advanced
Section titled “Advanced”Excluded Pairs (list) Specific cross-group pairs to exclude from detection. For example, exclude “Gripper” vs. “Workpiece” if gripper contact is intentional.
Status (Read-Only)
Section titled “Status (Read-Only)”Is Colliding — true when at least one collision is active
Active Collision Count — number of active collision pairs
Total Proxy Count — total managed collider proxies
Highlighted Renderer Count — renderers currently highlighted
Active Pairs — human-readable list of current collision pairs
Collider Mode Recommendations
Section titled “Collider Mode Recommendations”| Group Type | Recommended Mode | Reason |
|---|---|---|
| Robot joints | ExistingOnly | Manually placed capsule/box colliders are more precise |
| Machine frame | BoxApproximation | Many parts, coarse detection sufficient |
| Gripper / tools | MeshCollider | Accurate shape matters for contact detection |
| Safety zones | ExistingOnly | Manually placed box triggers as zone boundaries |
Typical Use Cases
Section titled “Typical Use Cases”Robot vs. Machine Frame — A 6-axis robot arm (Group “RobotArm”) moves near a machine frame (Group “MachineFrame”). Self-collision within the robot’s joints is suppressed. Any contact between robot and frame triggers a red blinking highlight and sets the PLC signal to stop the robot.
Gripper vs. Fixture — A gripper (Group “Gripper”) picks parts from a fixture (Group “Fixture”). Gripper-to-workpiece contact is excluded via Excluded Pairs. Only unintended gripper-to-fixture contact triggers an alarm.
Multiple Robots — Two robots (Group “Robot1”, Group “Robot2”) work in overlapping reach zones. Each robot’s internal joints don’t trigger alarms, but any robot-to-robot contact does.
Highlight Setup (URP)
Section titled “Highlight Setup (URP)”To use the highlight feature, you need a second MultiObjectOverlayRendererFeature in your URP Renderer:
- Open your URP Renderer Asset (typically
URP-Default-Renderer.asset) - Click Add Renderer Feature and select Multi Object Overlay Renderer Feature
- Name it “CollisionOverlay” to distinguish it from the selection overlay
- Assign this new feature to the Overlay Feature field on the GroupCollisionChecker
The existing overlay feature (used by the Selection system) remains untouched.
Scripting API
Section titled “Scripting API”// Manual setup (if AutoSetupOnStart is false)checker.SetupCollisionSystem();
// Clear highlights without resetting trackingchecker.ClearAllHighlights();
// Reset all tracking (highlights + active pairs)checker.ClearCollisionTracking();
// Subscribe to collision events via C# delegateschecker.OnGroupCollisionEnter += (objA, objB) => { Debug.Log($"Collision: {objA.name} <-> {objB.name}");};
checker.OnGroupCollisionExit += (objA, objB) => { Debug.Log($"Collision ended: {objA.name} <-> {objB.name}");};See Also
Section titled “See Also”- Group — assigning objects to groups
- Group Manager — hiding/showing groups at runtime
- Selection Window — filtering by groups in the editor
© 2025 realvirtual GmbH https://realvirtual.io - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.