This provides an example project illustrating the collider and rigidbody functionality of Unity 5. The default.unity scene contains an inverted cube (a cube with the normals reversed. Inside of the cube is a sphere representing an ionic particle (a particle with charge) The ion has a sphere collider with a physics material (Bouncy) and a rigidbody component. Together they make the ions and cube interact with the Unity Physics Engine. At start the Ions game object spawns a collection of Ion Prefabs. These ions all start with a random velocity and a positive charge. When they hit the walls they bounce and their polarity flops. If they hit an ion with an opposite charge they bond with one another by adding a FixedJoint component. The FixedJoint component also responds to the Unity Physics Engine. The joints are setup such that they will break if sufficient force or torque is applied. When the bond is broken the particles speed away from one another in opposite directions by applying forces to their respective rigidbodies that are proportional to their break force.
Data and Resources
Field | Value |
---|---|
Modified | 2018-09-27 |
Release Date | 2016-07-14 |
Publisher | |
Identifier | 6a4751c9-d9df-482e-816e-38ee5eafeb1e |
License | cc-by-nc |
Public Access Level | Public |