The following code will not change the TMP_Text “ScoreText” to what it should. I have also tried using ScoreText.Equals("testText"); but that also wont change the text. All of the other code works fine. Any solutions?
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
using TMPro;
public class LogicScript : MonoBehaviour
{
public GameObject pin;
public int pickPosition;
public CapsuleCollider2D pickCollider;
public CapsuleCollider2D pinCollider;
public int Score = 0;
public TMP_Text ScoreText;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0))
{
if (pickCollider.bounds.Intersects(pinCollider.bounds))
{
print("success");
Score = Score + 1;
ScoreText.Equals(Score);
}
else
{
Score = 0;
print("fail");
}
}
pinPositionSetter();
}

