I am brand new to coding and don’t know why I’m getting this error, this is my code to anyone that can help!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
private int selectedZombiePosition = 0;
public class GameManager: MonoBehaviour {
public GameObject selectedZombie;
public List zombies;
public Vector3 selectedsize;
public Vector3 defaultsize;
// Use this for initialization
void Start () {
SelectZombie (selectedZombie);
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown (“left”)) {
GetZombieLeft ();
}
if (Input.GetKeyDown (“right”)) {
GetZombieRight ();
}
Please use formatting to make your code readable. See the first post in the forum.
In other news, everything in a source file besides using and namespace pretty much has to be within the class definition brackets. You have at least one line outside of the class.
Hello,
I am new to the C# I am facing same issue with the same error. can anyone point out whats wrong with my code.
It would be great help. thanks in advance.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Debug.Log(“Bird Game”);
}
// Update is called once per frame
void Update()
{
if (Input.GetKey(“right”))
Flip(“right”);
{transform.Translate (.04f,0f,0f);
}
if (Input.GetKey(“left”))
Flip(“left”);
{transform.Translate (-.04f,0f,0f);
}
if (Input.GetKey(“up”))
{transform.Translate (0f,.04f,0f);
}
if (Input.GetKey(“down”))
{transform.Translate (0f,-.04f,0f);
}}
}
public void Flip( string direction){
var thescale = transform.localScale;