- Home /
Scaling Script?
Hello. I am trying to figure out how to make a script that I can attach to a folder ( An empty game object ) which contains all the objects. The script I am trying to make is to expand all the game objects by scaling both the X axis and Y axis if a certain game object is pressed. I can't seem to find any posts that relate. All help is appreciated. Also, this is not the first thing I've done, I've tried scripts but like I said they don't do exactly what is needed.
$$anonymous$$ake it work on one gameObject first.
Changing transform scale is basics.
Just so we speak the same language: Although the root GameObject may seem like a folder, its just a GameObject, and the "objects" it contains are "children" GameObjects. All these GameObjects have Transforms.
So, what you want is to iterate through the hierarchy of Transform children. The way to do this is, is shown in the Scripting Reference and has been answered many times in this forum:
http://docs.unity3d.com/ScriptReference/Transform.html
http://answers.unity3d.com/questions/10417/how-can-i-access-the-children-of-a-transform.html
Answer by GraviterX · Feb 16, 2015 at 01:46 AM
If you mean scaling like climbing, the FPS Input Controller that is included in the standard assets has a character script that allows you to edit how steep the surface has to be for the Player to scale it.
I think he means actually changing scale of the objects.
Sorry for confusion. When I say scaling, I mean as in making the object become bigger by increasing the size on the X axis and Y axis per second at a small amount. Basically imagine a circle beco$$anonymous$$g bigger.
O$$anonymous$$, I personally would make this an animation. Have a $$anonymous$$ey code.Yourkey statement to activate an animation.