i want to make RunButton clickable after Buying ShoesButton but only when character has enough money ex. $20 to buy Shoes
Thanks
i want to make RunButton clickable after Buying ShoesButton but only when character has enough money ex. $20 to buy Shoes
Thanks
Can you show the scripts related to it?
if ( money>= 20 ){
shoesBought = true;
money-=20;
}
if (shoesBought == true){
//Run code
}
Honestly, I only know some basic scripting. What you can do is:
using UnityEngine;
using System.Collections;
using UnityEngine.UI; // required when using UI elements in scripts
public class Example : MonoBehaviour {
public Button startButton;
public bool playersReady;
void Update ()
{
// checks if the players are ready and if the start button is useable
if (playersReady == true && startButton.interactable == false)
{
//allows the start button to be used
startButton.interactable = true;
}
}
}
And add a script that defines when the player is ready, maybe the one you showed to me (I do know how to script, but am still at the very start). Anyways, experiment with it, and tell me if it worked (script credit here)
(Btw, I also, have a problem at this forum)