- Home /
Periodic Boundary Condition in Unity
Hello everyone ! I'm actually using Unity to build a physical simulation of molecules.
To obtain the perfect result, using a periodic space would be ideal. I can make that whit a script that modify the transform of my gameObject to "move" it at the other side of the space. But I fear that it can be really expensive in term of simulation time. I also think that object "appearing" near other object will confuse the physical engine and make it no more accurate since every of this object have a Rigibody attached to it.
So I have 3 solutions and I wanted to have you insight on the most realistic than I can implement in Unity :
Having my objects bounce of the boundaries of my space handled by the physic engine.
Having my objects bounce of the boundaries of my space handled by a script.
Make the space a periodic one using a script to move at the other side of the space when colliding with the boundaries
Thanks you for you insight on the question !