Answers for "unity how to use trigger"

C#
3

how to use triggers in unity

//for collision detection
 void OnCollisionEnter(Collision collision)
{   }
// for use of triggering 
void OnTriggerEnter(Collider other)
{}
Posted by: Guest on May-18-2020
0

unity while in trigger

void OnTriggerStay(Collider other)
 {
   Debug.Log("This will be called every frame");
   if (Input.GetKeyDown("space") && other.tag == "TalkCylinder")          
   {
     Debug.Log("Talking");          
   }      
 }
Posted by: Guest on June-20-2020

C# Answers by Framework

Browse Popular Code Answers by Language