As i am new to unity i want to scale the object in x positive direction while i am trying to scale using scripting it was increasing in both x positive and negative i don’t want to do that i want to increase the size only in x positive direction. What should i do to come out that problem.

transform.localScale += Vector3(0.1,0,0); This is the command i used to scale it in x-axis but i want to increase the scale only in positive direction of x-axis. Anyone please help me out.

The scale transform is relative to the object center (or pivot point). It is not possible to modify it directly in Unity (if the model is imported from a 3D modelling app, you’d have to modify it there).

There’s a workaround using an empty gameobject. Here’s a link to another similar question describing the process

What you are talking about is scaling relative to a Pivot. Several possibilities:

- In your modeling program, place the Pivot at the “border” of wherever you want to do the scaling (the Pivot is the point that will not be shifted when scaling) (The back of your model?)
- In Unity, create an empty GameObject, move its center to where you want the Pivot to be, then attach your model to it. Now scale the parent. Watch out for any local transforms of your object.
- Via script without a Pivot object: Find out what your model dimension is. Then do a translation in addition to a scaling. But don’t use “+=” for scaling. transform.localScale
*= Vector3(1.1,1,1); transform.localPosition+=Vector3(modelDimension.x/2*(1.1-1),0,0); but this will get pretty complicated, especially if your x scale is no longer 1 and you want to apply the stretching a second time.

Also, grab a modeling tutorial and make yourself familiar with “Pivot”, rotation center, scale center, etc.

If you are talking instead of leaving the “negative” part of your object unmodified, while only stretching the “positive” part, then you’d have to breakup your model into two separate meshes, and scale them individually around the pivot.