Unity3D.tips[2]: Intersection point between two lines in 2D

The code The maths behind To get the point where two lines intersect, we will do some maths. To the mathematicians who will come across this post, I’m truly sorry for the heart attacks or strokes you may experience by reading this post. Ok, let’s take a look on the figure: First, sorry, I was …

Unity3D.tips[1]: Strategies to prevent the collision when a ball rolls from a planar surface to another

Method 1: mega box collider Use a single BoxCollider for all your planes. For example, if you have multiple aligned planes, remove their Collider component (Box, Mesh, whichever they have) and on only one of the planes, add a BoxCollider and adjust its center and size values in the component’s inspector to encapsulate all the …

Unity3D.tips[0]: Avoid naming your MonoBehaviour methods Main()

Try to avoid naming your MonoBehaviour methods Main(). These would be triggered between Awake() and Start(). This Main() method supports IEnumerator flavors as much as Awake() and alike! But as useful as it could be, I would not recommend to use it as there is no official documentation entry in the manual. And usually, you …