The final takeaway here is that we just covered a wide variety of topics, but at their core, there are two main reasons your shader functions aren't working. There were common mistakes to avoid when creating your materials and writing your shaders. The key thing that got most people unstuck was knowing how to debug their shaders.

oncollisionenter is declared but never used
Kod: Tümünü seç
//The problem is that you need to move this out of a void [e.g. void Start() or void Update()]
void OnCollisionEnter(Collision collision)
{
if (other.gameObject.tag == "Object")
{
Debug.Log ("Collided");
}
}
//Also same with OnCollisionEnter2D, OnTriggerEnter and OnTriggerEnter2d