Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

LuisJ95

8
Posts
1
Followers
16
Following
A member registered Jul 11, 2021

Recent community posts

hola quisiera pedirte un consejo donde puedo escribirte?

I agree with him,I agree with him, much more simplified and functional
many of us have already solved your problem, choose the one that suits you best, but a teacher taught me how to deal with conditionals that can be a bit #~@| so try to keep them as simplified as possible at the beginning so that you don't get headaches, I'm just saying

Change your button for the one I use :)

From my experience, the more flexible the code, the less chance there is that an error will appear, according to me :)

Use this

 public GameObject map1;

    bool map1active;

    public GameObject map2;

    bool map2active;

    // Start is called before the first frame update

    void Awake()

    {

        map1active = true;

        map1.SetActive(true);

        

        map2active = false;

        map2.SetActive(false);

    }

    // Update is called once per frame

    void Update()

    {

        if (Input.GetButtonDown("Jump"))

        {

            map1active = !map1active;

            map2active = !map2active;

            ChangeMap();

        }

    }

    void ChangeMap()

    {

        map1.SetActive(map1active);

        map2.SetActive(map2active);

    }

ho i see :)

I tried your code and it works what is the problem and what are you trying to do, to help you better I say