Hi, I feel like I’ve run into a brick wall of code because no matter what i do, this script gives me errors that don’t seem to make sense. As far as i can see, there isn’t actually anything wrong. Visual studio gives me no errors but there are 2 in unity itself.
The unity editor gives me errors cs1513: } expected and cs1022: Type or namespace definition, or end-of-file expected
Here is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class move : MonoBehaviour {
private Rigidbody rb;
public float movementSpeed = 10f;
public static int Collectibles;
private GameObject PlayerSphere;
public TextMeshProUGUI countText;
public TextMeshProUGUI countHP;
private float HP = 3f;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
Collectibles = 0;
HP = 3f;
setCountText();
setCountHP();
return;
}
//unity complains about this next line
void Awake() {
public Vector3 CurrentScale = (1.0f, 1.0f, 1.0f);
}
void setCountText()
{
countText.text = Collectibles.ToString();
}
void setCountHP()
{
countHP.text = HP.ToString();
}
void Update()
{
if (CurrentScale.x > 5f || CurrentScale.y > 5f || CurrentScale.z > 5f)
{
TooBig = true;
}
else
{
TooBig = false;
}
while (TooBig == false)
{
//transform.localScale += Vector3 CurrentScale(GiftCards + 0.1f, GiftCards + 0.1f, 0.2f);
}
}
// Update is called once per frame
void FixedUpdate()
{
if(HP < 0.5f)
{
countHP.text = ("You're Dead!");
OnPlayerDeath();
}
}
public void OnPlayerDeath()
{
countHP.text = ("Dead");
}
void OnTriggerEnter(Collider other)
{
if(other.CompareTag("Deadly"))
{
HP = HP -1;
setCountHP();
//gameplayManager.updateHealth(HP);
}
if (other.CompareTag("Collectible"))
{
other.gameObject.SetActive(false);
Collectibles= Collectibles+ 1;
setCountText();
}
}
//and this last line
}
I appreciate any and all help.

