//detect wall collision void OnTriggerEnter2D(Collider2D hitWall) { if ((hitWall.gameObject.tag == "Wall")) { playerAccess.setTopCollision(); } }