(51,16): error CS1061: 'Bounds' does not contain a definition for 'expand' and no accessible extensi

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent (typeof (BoxCollider2D))]
public class Controller2D : MonoBehaviour
{
public float skinWidth = .015f;
public int horizontalRayCount = 4;
public int verticalRayCount = 4;

float horizontalRaySpacing;
float verticalRaySpacing;

BoxCollider2D collider;
RaycastOrigins raycastOrigins;

void Start()
{
collider = gameObject.GetComponent();

}

void Update()
{
UpdateRaycastOrigins ();
CalculateRaySpacing ();

for (int i = 0; i < verticalRayCount; i ++)
{
Debug.DrawRay(raycastOrigins.bottomLeft + Vector2.right * verticalRaySpacing * i, Vector2.up * -2,Color.red);

}

}

void UpdateRaycastOrigins()
{
Bounds bounds = collider.bounds;
bounds.expand(skinWidth * -2);

raycastOrigins.bottomLeft = new Vector2(bounds.min.x, bounds.min.y);
raycastOrigins.bottomRight = new Vector2(bounds.max.x, bounds.min.y);
raycastOrigins.topLeft = new Vector2(bounds.min.x, bounds.max.y);
raycastOrigins.topRight = new Vector2(bounds.max.x, bounds.max.y);
}

void CalculateRaySpacing()
{
Bounds bounds = collider.bounds;
bounds.expand (skinWidth * -2);

horizontalRayCount = Mathf.Clamp(horizontalRayCount, 2, int.MaxValue);
verticalRayCount = Mathf.Clamp(verticalRayCount, 2, int.MaxValue);

horizontalRaySpacing = bounds.size.y / (horizontalRayCount - 1);
verticalRaySpacing = bounds.size.x / (verticalRayCount - 1);
}

struct RaycastOrigins
{
public Vector2 topLeft, topRight;
public Vector2 bottomLeft, bottomRight;

}
}

FYI. this is a scripting issue and not a 2D specific issue so should be posted on the Scripting forum. Regardless, when you post code, please use code-tags (you can go back an edit it too) because a wall of plain-text is difficult to read. Also, when you get an error, also state what line the error is on.

As to your error, a quick look at the API docs would reveal your problem so that’s something you should try to do in the future to keep you moving forward. C# is case sensitive so it’s Bounds.Expand and not Bounds.expand. It’s an easy mistake to make but if the compiler doesn’t understand it then it’s either mispelt, has the wrong case or just doesn’t exist.