Skip to content

Group Collision Checker (Pro)

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

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.

  1. Add a GroupCollisionChecker component to any GameObject in your scene
  2. Add entries to Collision Groups — each entry is a realvirtual Group name plus a collider mode
  3. Optionally assign a MultiObjectOverlayRendererFeature reference for GPU-based highlighting
  4. Press Play — collisions are detected and reported via signals, events, and Inspector status

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.

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 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

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.

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.

Excluded Pairs (list) Specific cross-group pairs to exclude from detection. For example, exclude “Gripper” vs. “Workpiece” if gripper contact is intentional.

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

Group TypeRecommended ModeReason
Robot jointsExistingOnlyManually placed capsule/box colliders are more precise
Machine frameBoxApproximationMany parts, coarse detection sufficient
Gripper / toolsMeshColliderAccurate shape matters for contact detection
Safety zonesExistingOnlyManually placed box triggers as zone boundaries

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.

To use the highlight feature, you need a second MultiObjectOverlayRendererFeature in your URP Renderer:

  1. Open your URP Renderer Asset (typically URP-Default-Renderer.asset)
  2. Click Add Renderer Feature and select Multi Object Overlay Renderer Feature
  3. Name it “CollisionOverlay” to distinguish it from the selection overlay
  4. Assign this new feature to the Overlay Feature field on the GroupCollisionChecker

The existing overlay feature (used by the Selection system) remains untouched.

// Manual setup (if AutoSetupOnStart is false)
checker.SetupCollisionSystem();
// Clear highlights without resetting tracking
checker.ClearAllHighlights();
// Reset all tracking (highlights + active pairs)
checker.ClearCollisionTracking();
// Subscribe to collision events via C# delegates
checker.OnGroupCollisionEnter += (objA, objB) => {
Debug.Log($"Collision: {objA.name} <-> {objB.name}");
};
checker.OnGroupCollisionExit += (objA, objB) => {
Debug.Log($"Collision ended: {objA.name} <-> {objB.name}");
};


© 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.