Answers for "how to use triggers unity"

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
1

how to use triggers unity

void OnTriggerEnter(Collider other)
{
	Debug.Log("Object Entered the trigger");
}

void OnTriggerStay(Collider other)
{
	Debug.Log("Object is within the trigger");
}

void OnTriggerExit(Collider other)
{
	Debug.Log("Object Exited the trigger");
}
Posted by: Guest on June-13-2021

C# Answers by Framework

Browse Popular Code Answers by Language