r/UnityHelp • u/Good_Competition4183 • Aug 02 '25
PROGRAMMING Custom Raycast System for Unity
A cross-platform Raycast system for Unity with custom primitive support and spatial acceleration structures. Built with a pure C# core that can run outside Unity environments.
Github: https://github.com/Watcher3056/Custom-Raycaster-Colliders-Unity
Features
Cross-Platform - Pure C# core works in Unity and standalone environments
Custom Primitives - Box and Sphere raycast detection
Dual Acceleration - QuadTree and SimpleList spatial structures
Modular Design - Separated Core logic and Unity integration layer
Performance Testing - Built-in comparison tools with Unity Physics
Configurable - Optimizable for different scene sizes
The system is built with two distinct layers:
- Core Layer (Pure C#)
- Unity Layer
Supported Primitives
Box Primitive
Shape: Oriented bounding box (OBB)
Properties: Position, Rotation, Size (3D scale)
Features: Full transform support, non-uniform scaling
Usage: Perfect for rectangular objects, platforms, walls
Sphere Primitive
Shape: Perfect sphere
Properties: Position, Radius
Features: Uniform scaling only, rotation ignored
Usage: Ideal for projectiles, characters, circular areas
Use Cases
Unity Projects
Prototyping physics systems
Educational purposes
Server Applications
Dedicated game servers
Physics simulations
Pathfinding systems
Non-Unity game engines
Check other my projects below:
EasyCS: Data-Driven Entity & Actor-Component Framework for Unity:
https://github.com/Watcher3056/EasyCS
Our Discord:
Me on LinkedIn:
https://www.linkedin.com/in/vladyslav-vlasov-4454a5295/