parsing error but cannot see how to fix it?

i have a parsing error with the very last symbol of the code how can i fix this?

using UnityEngine;
using System.Collections;

public class Generator : MonoBehaviour {

	// Use this for initialization
	void Start () {
		GenerateChunks();
	}
	
	void GenerateChunks()
	{
		Vector3[] chunks = new Vector3[render_distance*render_distance];
		bool[] chunksbool = new bool[render_distance*render_distance];
		
		int i = 0;
		
		for(int x=(render_distance/2)*-1;x<render_distance/2;x++)
		{
			for(int z=(render_distance/2)*-1;z<render_distance/2;z++)
			{
				int px = Mathf.RoundToInt(player.transform.position.x /16) * 16;
				int pz = Mathf.RoundToInt(player.transform.position.z /16) * 16;
				px = px+(x*16);
				pz = pz+(z*16);
				chunks[i] = new Vector3(px,0,pz);
				chunksbool[i] = true;
				i=i+1;
			}
		}
		
		for(i=0;i<render_distance*render_distance;i++)
		{
			foreach (Transform child in transform)
			{
				if(child.transform.position == chunks[i]) { chunksbool[i]=false;
					
				}
			}
		}
		for(i=0;i<render_distance*render_distance;i++)
		{
			if(chunksbool[i])
			{
				CreateChunk(chunks[i]);
			}
		}		
	}

	void CreateChunk(Vector3 pos)
	{
		Transform chunk = Instantiate(Chunk,pos,Quaternion.identity) as Transform;
		chunk.transform.parent = transform;
		
	}
	void DestroyChunks()
	{
		int px = Mathf.RoundToInt(player.position.x/16) * 16;
		int pz = Mathf.RoundToInt(player.position.z/16) * 16;
		int renderer = Mathf.RoundToInt(render_distance + (render_distance/2));
		
		
		foreach (Transform child in transform)
		{
			Vector2 ch = new Vector2(child.transform.position.x,child.transform.position.z);
			Vector2 pl = new Vector2(player.transform.position.x,player.transform.position.z);
			
			
			float dist = Vector2.Distance(ch,pl);
			
			if(dist>renderer*20)
			{
				Destroy(child.gameObject);
				
			}	
		}
	}
	// Update is called once per frame
	void Update () {
		
		GenerateChunks();
		DestroyChunks();
		{

	}

You’re not likely to get much help unless you show the specific error you’re getting (cut and paste it). It should contain some detailed info that’ll help in resolving the problem.

Jeff

it is literally saying error CS8025: parsing error for this line here

// Update is called once per frame

void Update () {

GenerateChunks();

DestroyChunks();

{

}

You have 2 open brackets in your update method and only one close bracket.
There has to be a close bracket for every open bracket.

As Ingot said, you have two opening brackets and only one closing bracket.

Also, regarding your PM, you can post in one of the links in my signature if you have any Cubiquity-specific questions. Obviously general scripting questions such as this one belong here.

i removed it so there was 1 open bracket but its still giving me the exact same error

Sorry, my mistake. The closing bracket was actually for the class (not the function) so you do need it. But your second opening bracket is pointing the wrong way as it should be a closing bracket for the function.

Basically, you’ll make your life easier if you use consistent indentation so you can see which brackets are paired up. The code below fixes your parse error, but it still doesn’t compile for me (e.g. render_distance is not defined). But you probably know how to fix this.

using UnityEngine;
using System.Collections;
 

public class Generator : MonoBehaviour
{
    // Use this for initialization
    void Start ()
	{
        GenerateChunks();
    }

    void GenerateChunks()
    {
        Vector3[] chunks = new Vector3[render_distance*render_distance];
        bool[] chunksbool = new bool[render_distance*render_distance];        

        int i = 0;

        for(int x=(render_distance/2)*-1;x<render_distance/2;x++)
        {
            for(int z=(render_distance/2)*-1;z<render_distance/2;z++)
            {

                int px = Mathf.RoundToInt(player.transform.position.x /16) * 16;
                int pz = Mathf.RoundToInt(player.transform.position.z /16) * 16;
                px = px+(x*16);
                pz = pz+(z*16);
                chunks[i] = new Vector3(px,0,pz);
                chunksbool[i] = true;
                i=i+1;
            }
        }     

        for(i=0;i<render_distance*render_distance;i++)
        {
            foreach (Transform child in transform)
            {
                if(child.transform.position == chunks[i])
				{
					chunksbool[i]=false;  
                }
            }
        }

        for(i=0;i<render_distance*render_distance;i++)
        {
            if(chunksbool[i])
            {
                CreateChunk(chunks[i]);
            }
        }    
    }

 

    void CreateChunk(Vector3 pos)
    {
        Transform chunk = Instantiate(Chunk,pos,Quaternion.identity) as Transform;
        chunk.transform.parent = transform;  
    }

    void DestroyChunks()
    {
        int px = Mathf.RoundToInt(player.position.x/16) * 16;
        int pz = Mathf.RoundToInt(player.position.z/16) * 16;
        int renderer = Mathf.RoundToInt(render_distance + (render_distance/2));

        foreach (Transform child in transform)
        {
            Vector2 ch = new Vector2(child.transform.position.x,child.transform.position.z);
            Vector2 pl = new Vector2(player.transform.position.x,player.transform.position.z);
			
            float dist = Vector2.Distance(ch,pl);
			
            if(dist>renderer*20)
            {
                Destroy(child.gameObject);
            }  
        }
    }

    // Update is called once per frame

    void Update ()
	{
        GenerateChunks();
        DestroyChunks();
	}
}