Hi there. I have a project due tomorrow where I’m using this code:
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour
{
public float speed;
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);
}
}
}
Destroy(other.gameObject);
gameObject.tag= "Player";
gameObject.SetActive(false);
But I keep getting a ton of errors. Such as parsing, or identifier unexpected? The project I’m working on is due tommorow, I’d appreciate help haha. Thanks~