x


How to modify the SIZE of the standard game objects?

Is it possible to modify the size of the standard game objects (e.g. plane, cube, etc.) instead of scaling them?

I need the width and length of objects to position them side by side. When I scale the objects I have to consider the scale factor and that makes positioning more difficult than necessary. So is there a possibility to get an change the size of these objects?

more ▼

asked Mar 02 '10 at 12:34 PM

tasbar gravatar image

tasbar
220 3 8 14

@tasbar, I don't have Unity right here, but if you put a Cube in position (0, 0, 0) and another Cube in (1, 0, 0) and both cubes with the scale of 1 in all dimensions, are they touching each other or overlapping?

Mar 02 '10 at 12:45 PM Lipis

Yes, they are touching as a cube has the size of 1 unit.

Mar 02 '10 at 01:02 PM tasbar
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

You can't.

If your project specifically requires this, you might consider making your own versions of the primitives by building a mesh from scratch using the Mesh API. That way, you can position the vertices wherever you like so that your object is at the desired size when its scale is 1,1,1.

more ▼

answered Mar 02 '10 at 01:18 PM

duck gravatar image

duck ♦♦
41k 92 148 415

(comments are locked)
10|3000 characters needed characters left

I think the scale in the standard game objects, is the actual size of the object.

more ▼

answered Mar 02 '10 at 12:48 PM

Lipis gravatar image

Lipis
2.2k 10 22 48

No, the scale is a multiplier. I already checked that. When you scale a cube by a scale of 10, it is ten units tall as it has a size of one unit. The same scale for a plane means a size of 100 units, as a plane has a standard size of 10 units. So you always need to know the standard size of all objects to calculate its real size. I would just like to get and modify the size.

Mar 02 '10 at 01:01 PM tasbar

Hmm.. Plane then it's a different case.. cause how many planes you'll have in one scene anyways? With the rest of the standard objects you won't have a problem. But you might get into troubles if you'll start combining them and asking for the scale of the parent object. Besides that, you shouldn't have any problems. (check also if you can do something with the Vector3.magnitude)

Mar 02 '10 at 01:22 PM Lipis
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x386
x286

asked: Mar 02 '10 at 12:34 PM

Seen: 4802 times

Last Updated: Mar 02 '10 at 12:34 PM