Search code examples
unity-game-enginegame-physicsphysicsphysics-engine

constrain unity rigidbody to dynamically changing plane


I am making a physics based tank game, I need to keep the tracks (made up of many individual links, each with a Joint and a Rigidbody) on the guide wheels, I don't really know the best way of doing this, I want the game to be as physics based as possible but I don't want to simulate a pointlessly high level of detail (want to avoid mesh colliders as much as possible). It should be fine to constrain the links to a plane defined by the guide wheels, but I can't see a good way to do this. Any suggestions are apricated as to how I could achieve the desired affect, please keep in mind that the links use box colliders.


Solution

  • I have realised this is possible with configurable joints. Since spacial contraints are defined in local space, it should be possible to get the desired effect without too much difficulty.