I'm following the series of creating the 2D-game using Unity and Visual studio. Because I'm using Unity 5 rather than 4.5 I have ran into some trouble.

The original code created in the tutorial has the following function:
Code:
private void CalculateRayOrigins()
	{
		var size = new Vector2(_boxCollider.size.x * Mathf.Abs(_localScale.x), _boxCollider.size.y * Mathf.Abs(_localScale.y)) / 2;
		var center = new Vector2(_boxCollider.center.x * _localScale.x, _boxCollider.center.y * _localScale.y);

		_raycastTopLeft = _transform.position + new Vector3(center.x - size.x + SkinWidth, center.y + size.y - SkinWidth);
		_raycastBottomRight = _transform.position + new Vector3(center.x + size.x - SkinWidth, center.y - size.y + SkinWidth);
		_raycastBottomLeft = _transform.position + new Vector3(center.x - size.x + SkinWidth, center.y - size.y + SkinWidth);
	}
I cannot use the same, since the center-function for Boxcollider2D has been deprecated by the offset function. My code didn't work just by replacing the center with the offset so I ended up with the following code:
Code:
private void CalculateRayOrigins()
    {
        var size = new Vector2(_boxCollider.size.x * Mathf.Abs(_localScale.x), _boxCollider.size.y * Mathf.Abs(_localScale.y)) / 2;
        var center = new Vector2(_boxCollider.offset.x * _localScale.x, _boxCollider.offset.y * _localScale.y);

        _raycastTopLeft = _transform.position + new Vector3(center.x - size.x - SkinWidth, center.y + size.y + SkinWidth);
        _raycastBottomRight = _transform.position + new Vector3(center.x + size.x + SkinWidth, center.y - size.y - SkinWidth);
        _raycastBottomLeft = _transform.position + new Vector3(center.x - size.x - SkinWidth, center.y - size.y - SkinWidth);
    }
Now I can move the player in the game in the way it's supposed to move, but the character never actually collides with any other boxcolliders but insteads just kinda floats about. Any help to fix my problem would be greatly appreciated!