local scale not working?

hi, i have a script for randomly placing trees in a certain area. it keeps giving me the error:
error CS1502: The best overloaded method match for `UnityEngine.Vector3.Vector3(float, float, float)’ has some invalid arguments. i do not know what to do. please help!

public class TreePlacer : MonoBehaviour
   List<GameObject> treesList = new List<GameObject>();
    public GameObject tree1;
    public GameObject tree2;
    public GameObject tree3;

    // Instantiate the prefab somewhere between -10.0 and 10.0 on the x-z plane
    void Start()

	for (int i = 0; i < 10; i++)
        Vector3 position = new Vector3(Random.Range(-10.0f, 10.0f), 0, Random.Range(-10.0f, 10.0f));
        int prefabIndex = UnityEngine.Random.Range(0,3);
        GameObject newTree = Instantiate(treesList[prefabIndex], position, Quaternion.Euler(270, 0, 0));
	newTree.transform.localscale = new Vector3(0.07, 0.07, 0.07);

First. Install Visual Studio and use it to edit your code. The red underlines would have told you what you needed to know and you wouldn’t have had to wait for this answer.

Second, the problem is that you are using doubles where floats are required.


new Vector3(0.07, 0.07, 0.07)


new Vector3(0.07f, 0.07f, 0.07f)

I have been using notepad because visual studio and mono develop both crash my computer.
PS i am very new to unity. but i still get the error: error CS1061: Type UnityEngine.Transform' does not contain a definition for localscale’ and no extension method localscale' of type UnityEngine.Transform’ could be found. Are you missing an assembly reference? im probably missing something obvious

Yes, be sure to use floats instead of doubles. Also you have a typo. So change:

newTree.transform.localscale = new Vector3(0.07, 0.07, 0.07);


newTree.transform.localScale= new Vector3(0.07f, 0.07f, 0.07f);