- Home /
Question by
ikarus2012 · Jun 13, 2017 at 07:19 PM ·
scripting problemplayercamera-movementroll a ballcamera controls
Error in roll a ball script: unkown where to address [ATM]
1. Assets/_Completed-Game/Scripts/CameraController.cs(4,14): error CS0101: The namespace global::' already contains a definition for
CameraController' 2. Assets/_Completed-Game/Scripts/PlayerController.cs(5,0): error CS1525: Unexpected symbol `void'
using UnityEngine;
using System.Collections;
void Start()
{
count = 0;
SetCountText();
winText.text = "";
}
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rigidbody.AddForce(movement * speed * Time.deltaTime);
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "PickUp")
{
other.gameObject.SetActive(false);
count = count + 1;
SetCountText();
}
}
void SetCountText()
{
countText.text = "Count: " + count.ToString();
if (count >= 12)
{
winText.text = "YOU WON!";
}
}
What I did was add a assest script for a camera that threw the whole work I had done off
Comment