UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a baseplate"
using UnityEngine; public class Baseplate : MonoBehaviour { public float width = 10f; public float length = 10f; public float height = 0.5f; public Material baseplateMaterial; // Start is called before the first frame update void Start() { CreateBaseplate(); } void CreateBaseplate() { GameObject baseplate = GameObject.CreatePrimitive(PrimitiveType.Cube); baseplate.transform.localScale = new Vector3(width, height, length); baseplate.transform.position = new Vector3(0, -height / 2, 0); if (baseplateMaterial != null) { baseplate.GetComponent<Renderer>().material = baseplateMaterial; } } }