C# CS1513 } expected

Barrett, Carl 21 Reputation points

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class mapgenorator : MonoBehaviour
public GameObject Prevceiling;
public GameObject Prevfloor;
public GameObject ceiling;
public GameObject floor;

public GameObject player;

// Start is called before the first frame update
void Start()


// Update is called once per frame
void Update()
    if (player.transform.position.x > floor.transform.position.x)
        var tempCeiling = Prevceiling;
        var tempFloor = Prevfloor;
        Prevceiling = ceiling;
        Prevfloor = floor;
        tempCeiling.transform.position += new Vector3(54, 0, 0);
        tempFloor.transform.position += new Vector3(54, 0, 0);
        ceiling = tempCeiling;
        floor = tempFloor;
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,633 questions
0 comments No comments
{count} votes

2 additional answers

Sort by: Most helpful
  1. Nasreen Akter 10,791 Reputation points

    Hi @Barrett, Carl ,

    I think you are missing closing } at the end of your program. Thanks!

    1 person found this answer helpful.
    0 comments No comments

  2. Duane Arnold 3,216 Reputation points

    If you like a different background color than the default white, like I like a grey background, it helps my eye, then you can change the color of the structure grid lines too.


    0 comments No comments