C# CS1513 } expected

Barrett, Carl 21 Reputation points
2021-03-17T00:37:08.833+00:00

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;
    }
}
C#
C#
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
    2021-03-17T00:44:11.953+00:00

    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
    2021-03-17T05:09:22.7+00:00

    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.

    https://dailydotnettips.com/how-to-customize-structure-guide-lines-colors-in-visual-studio-2017/

    0 comments No comments