Cable Physics
ForkReal-time cable physics simulation for interactive environments. Features dynamic connectors with color-coded male/female types, cable stretching with automatic disconnection, collision detection between overlapping cables, and full movability of connection points. Includes sample player controller, interaction scripts, and demo scene. Production-tested in the game Errata.
Unity Project
Built with Unity 2021.3.15f1 · download the source from GitHub

Dependencies (41)
README
Cable physics
Real-time simulation of cable behaviors, such as:
- move - connectors that can be lifted and moved
- connect to the connector - keeps divided into colors and male and female connectors
- stretching - the cable can extend to the designated length, after exceeding it, the cable disconnects from the connector, returning to the neutral length
- overlapping cables - they have collisions with each other and can be lifted and moved
Cable behavior demonstration video: youtube.com/Hrober/cables-physics
The whole system was used in-game named Errata.
Errata trailer: youtube.com/Errata/errata-trailer
Project structure
Cables scripts
Main cable script:
github.com/Hrober0/Cable-physics/Assets/PhysicCalbes/Scripts/PhysicCable.cs
Cable connector script:
github.com/Hrober0/Cable-physics/Assets/PhysicCalbes/Scripts/Scripts/Connector.cs
Interactions scripts
Scripts required to interact with cables:
github.com/Hrober0/Assets/Interactions
(Whose dependencies can be easily removed)
Sample player controller
Sample first-person player controller used to show sample of interaction with cables:
github.com/Hrober0/Assets/SamplePlayerController
Sample scene
Sample scene used to show sample of interaction with cables:
github.com/Hrober0/Assets/Scenes
Scene contains plyer, basic environment and some cables and connectors.
Used Technologies
Unity
C#
Used Packages
NaughtyAttributes
NaughtyAttributes is an extension for the Unity Inspector.
It expands the range of attributes that Unity provides so that you can create powerful inspectors without the need of custom editors or property drawers. It also provides attributes that can be applied to non-serialized fields or functions.
Link: https://github.com/dbrizov/NaughtyAttributes
Comments
No comments yet. Be the first!
Sign in to join the conversation
Sign In