Physics class in the Unity engine has many methods related to detecting collisions with other physical objects. One of such methods is Raycast, but do you know that you can also cast different shapes?
Let’s explore the world of physics casts and see know to use them!
Continue reading “Different types of raycasts in Unity”
Let’s talk about OnTrigger methods in Unity! Do you know when they are invoked or for what you can use them? Let’s see in this post! ?
In one of the recent posts, we spoke about
OnCollision methods and the fact that Unity has two separate physics engines.
Of course, like with collisions, there are different trigger methods for the 2D and the 3D engines. For 3D there are
, OnTriggerEnter() and OnTriggerStay() methods. For 2D there are almost the same OnTriggerExit() , OnTriggerEnter2D() and OnTriggerStay2D() methods. OnTriggerExit2D() Continue reading “Understanding OnTrigger methods in Unity”
In this post, we’ll talk about Unity methods related to collisions. So fasten your seatbelt as we are heading into collision! ?
Currently, in Unity, there are
two separate physics engines. One for 3D physics, and another one for 2D. Both work in the very same manner, but they are using different components.
So for example, if we want to turn an object into a physical object in 3D space, we would use
Rigidbody. Analogous we would use Rigidbody2D if we want to turn it into a 2D physical object. Continue reading “Understanding OnCollision methods in Unity”