Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

unity check for collision on specific layer code example

Example: unity check collider layer

function OnCollisionEnter(collision : Collision)
 {
     if (collision.collider.gameObject.layer == LayerMask.NameToLayer("LAYER_NAME"))
     {
          Debug.Log("Touched a rail");
     }
 }

Tags:

Csharp Example

Related

find out if a user belongs to a group django code example wtform select send code example shift array to left c code example test if bash variable is empty code example php using api code example setenv password mariadb code example javascript check if object is empty? code example laravel password_verify code example color : gradient flutter code example rotate xlabels code example how to change size of image in latex code example class with constructor python code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy