I want to add 5 to size the of Box Collider, but when I type it, it gives an Error.

I want to add 5 to size the of Box Collider, but when I type it, it gives an Error.

Hello @anon91383715,
BoxCollider’s size is a Vector3, it’s a cube so it has 3 dimensions:
GetComponent<BoxCollider>().size = new Vector3(5, 5, 5);
You can also do
GetComponent<BoxCollider>().size = Vector3.one * 5;
thank you so much
– anon91383715