-4
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MOVIMENTO : MonoBehaviour
{
private float spd = 0.9f;
private GameObject camera;
private GameObject gameOverUI;
public bool gameOver;
// Start is called before the first frame update
void Start()
{
camera = GameObject.Find("Camera");
gameOver = false;
gameOverUI = GameObject.Find("GAME OVER");
gameOverUI.gameObject.active - false;
}
// Update is called once per frame
void Update()
{
if (gameOver == false) {
//camera.transform.position = transform.position - new Vector3(-12f ,-3 ,0 );
//if (Input.GetKey("w"))
transform.position += new Vector3(-spd ,0 ,0 );
if (Input.GetKey("d"))
transform.position += new Vector3(0 ,0 ,spd );
//if (Input.GetKey("space"))
//transform.position += new Vector3(0 ,2 ,0 );
if (Input.GetKey("a"))
transform.position += new Vector3(0 ,0 ,-spd );
//if (Input.GetKey("space"))
//transform.position += new Vector3(0 ,2 ,0 );
//NITRO
//if (Input.GetKey("c"))
//transform.position += new Vector3(-1 ,0 ,0 );
if (Input.GetKey("e"))
Debug.Log("PRESTOU!");
public void OnCollisionEnter(Collision obj){
if (obj.gameObject.tag == "POLICIAL BOSTA") {
gameOverUI = gameObject.active = true;
gameOver = true;
Application.LoadLevel(Application.loadedLevel);
Debug.Log("JAERA!");
if (obj.gameObject.tag == "Caio") {
transform.position += new Vector3(0 ,2 ,0 );
//if (obj.gameObject.tag == "Vitor") {
//transform.position += new Vector3(-4 ,0 ,0 );
//}
//if (obj.gameObject.tag == "Arta") {
//transform.position += new Vector3(0 ,2 ,0 );
//}
if (obj.gameObject.tag == "Fim da linha") {
Application.LoadLevel(Application.loadedLevel);
if (obj.gameObject.tag == "NITRO") {
transform.position += new Vector3(-9 ,0 ,0 );
}
}
}
I’m trying to make a game in Unity, only q ta giving error to open and close keys "{}" ai n da to run the game because of this,:
Assets MOVIMENTO.Cs(46,5): error CS0106: The Modifier 'public' is not Valid for this item
what I do to solve?
Start writing your code.
– Augusto Vasques
After the
Debug.Log("JAERA!");
missing one}
– Bruno Warmling