Okay so I need to fix the scoring for my game. I want score = (Time x 10)+(count x 10) and I am referencing count from finishline script and Time from Player script. I dont understand why It not working? smh please help!
using UnityEngine;
using System.Collections;
using UnityEditor;
public class Score : MonoBehaviour
{
public GUIText TheScore;
public float myScore;
//Script Reference
// public Clock myTimer;
// public Finishline count;
void Start()
{
GameObject Player = GameObject.Find ("Player");
Clock2 Timer = Player.GetComponent<Clock2> ();
GameObject finishline = GameObject.Find("finishline");
Finishline count = finishline.GetComponent<Finishline>();
}
public int Timestop = Clock2.Timer.myTimer*10;
public int Balls = Finishline.count*10;
void Update()
{
if (Time >= 300) //why is myTimer isnt working?
{
myScore = Timestop + Balls;
}
if (count = 12) //why is count isnt working?
{
myScore = Timestop + Balls;
}
}
}