Adding features to text101

Please see above images.

The idea is, I want to modify the state.nextStates[1] for Room 1A.

I can access the correct State element via state.nextStates[1]… but what do I assign it to?

I want it to be assigned to the Room2S state instead of Room2B but WHAT is that state in code form?

state.nextStates[1] = // code to specify the Room2S state

Any help is appreciated!!

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

Privacy & Terms