Transform.LocalScale Script Problem. Please help.

Hello. I’d like to start off by saying that I am very new to Script and creating games, so all help is appreciated. I am trying to create a script that, when a certain object is touched, all objects within the folder would expand (Transform.LocalScale). I can’t even figure out how to simply expand an object when it is touched. Just to clarify, when I say expand I mean that when the object is touched once it would continually expand. All help is appreciated.

There are tutorials on Unity3d. Search for how to do OnCollision in Unity. That should help you.

You’ve not provided the language in which your attempting this, heres a c# solution.
heres a rough idea of how to achieve this, firstly your going to want a method to detect whether the object has been clicked i think the simplest way of doing this is with MouseOver/MouseExit functions

the following script should be placed upon the object your clicking

using UnityEngine;
using System.Collections;

public class AddUnitToSelection : MonoBehaviour {

	public bool hover;
	GameObject gameController;
	// Use this for initialization
	void Start () {
		gameController = GameObject.FindGameObjectWithTag ("GameController");
	}
	
	// Update is called once per frame
	void Update () {
		if(hover && Input.GetButtonDown("Fire1")) {
			gameController.GetComponent<SelectedUnit>().SetUnit(gameObject.transform);
		}
	}
	void OnMouseOver() {
		hover = true;
	}
	void OnMouseExit() {
		hover = false;
	}
}

this script can be placed anywhere in the scene but be sure to Tag the object as GameController.

    using UnityEngine;
    using System.Collections;
    
    public class SelectedUnit : MonoBehaviour {
    
    
    	public Transform SelectedUnit;
    	// Use this for initialization
    	void Start () {
    	
    	}
    	
    	// Update is called once per frame
    	void Update () {
    	// here is where we will set the scale of the object we clicked before removing the selection
        if(SelectedUnit != null) {
          SelectedUnit.localScale = SelectedUnit.localScale * 2; // double the size
          SelectedUnit = null; // Empty the selection
}
    	}
        // this is where set the selected unit based off the object we clicked, Object we clicked
        // Must have a Collider aswell as the first script attatched to it.
    	public void SetUnit(Transform tr) {
    		SelectedUnit = tr;
    	}
    }

if you need more information on how they work just ask.