Category Physics and Mathematics

Raycast and Overlap in Unity

Unity raycast presentation

In this comprehensive guide, we delve into the powerful tools of raycast and overlap within Unity, offering a detailed exploration of their functionalities and applications. Table of Contents Common Parameters Basic Raycast (Physics.Raycast) Raycast All Raycast NonAlloc RaycastHit BoxCast SphereCast…

Mastering LayerMask in Unity

Unity layer mask inspector

LayerMask in Unity are essential for specifying one or more layers on which specific actions can be applied. Think of them as arrays containing layers. Table of Contents Using Layers Through the Inspector Creating a LayerMask in Code LayerMask with…

Unity How to lock rotation

Unity how to lock rotation

As usual on Unity, properties can be modified by code or using the Inspector.To lock a rotation, we’ll need to use the properties of the Rigidbody2D or Rigidbody components. Lock rotation of an 2D object In the 2D world, a…