I have a script that increases the scale of an object every few seconds and it works just fine. However, as the object increases in size, it moves around the scene in a set direction. Is there any way of stopping the item from doing this?
You use “Transform.localScale” ?
Does it have rigidbody component…?
You are scaling parent object and the children objects start to move?
var atm : UnityEngine.GameObject;
atm = GameObject.Find(“Load ATM”);
atm.transform.localScale += Vector3(0.01,0.01,0.01);
I’m a bit new at this so I’m not sure if I am scaling a parent or not. It is just a simple object I imported into the scene with the name of atm. This is just a test object while I work on the scripting but it will be similar to the objects it will be used on.
I watch the position as it scales and it doesn’t change.
Then your imported object is probably not centered around its pivot, which is where all scaling is extended from.
I didn’t think about that. Is that something I would have set when modeling the item? When I created it, it wasnt at 0,0 in the editor I used.
That was the problem. I centered the object and imported it back it and it works great.