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
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
Scripts required to interact with cables:
github.com/Hrober0/Assets/Interactions
(Whose dependencies can be easily removed)
Sample first-person player controller used to show sample of interaction with cables:
github.com/Hrober0/Assets/SamplePlayerController
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.
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