this is my code
using UnityEngine;
public class PlayerCollision : MonoBehaviour
{
void OnCollisionEnter (Collision collisionInfo)
{
If (collisionInfo.collider.name == “Obstacle”)
{
Debug.Log(“We hit it a obstacle”);
}
}
}
I am following brackeys tutorial and made it to ep 5 just to get stumped
Hey!
Code can be really finicky. In this line If (collisionInfo.collider.name == "Obstacle") your “if” has a capitalized “I” It is case sensitive so it needs to be lower case.
Also, as a side tip, when you post in the forum surround your code with the code block by selecting the code option in the upper panel to turn it into a code block.