i am new about 4 days coading but i think i found the answer well i tested it on my coad and it work
after more research and wanting to do this myself i found a workaround but i don’t know how to reset it
my State.cs has
[SerializeField] public string gameid;
public string Getgameid()
{
return gameid;
}
just use the 1 you have stateID instead of gameid
void Update()
{
fly();
badengins();
}
to make it check every frame
private void badengins()
{
if (state.gameid == "engincheck")
{
engin = true;
}
}
private void fly()
{
if (state.gameid == "boom" && engin == true)
{
var nextStates = state.GetNextStates();
state = nextStates[0] = state = nextStates[1];
engin = false;
}
else if (state.gameid == "boom" && engin == false)
{
var nextStates = state.GetNextStates();
state = nextStates[0] = state = nextStates[2];
}
}
add the first nextStates[0] as the 1 you what to change and state = nextStates[2]; to the 1 you what in it place
hope this help you a bit sorry about other post i was using a [SerializeField] to call the next opshon