I’m a new unity dev who is currently watching Brackeys tutorial. After finishing episode 5, I decided to add the ability to jump, It didn’t go as planned. (I’m still new to C#) I ended up just deleting the extra
code. But after doing this my collision script stopped recognizing collision. My code is exactly the same as his, (Or at least I think it is), Any ideas as to why this is happening?
public class PlayerCollision : MonoBehaviour {
public PlayerMovement movement;
void OnCollisionEnter (Collision collisionInfo)
{
if (collisionInfo.collider.tag == "Obstacle")
{
movement.enabled = false;
Debug.Log("hit!"); // This does nothing
}
}
}