Forum begins after the advertisement:
[Part 7] Map problem
Home › Forums › Video Game Tutorial Series › Creating a Metroidvania in Unity › [Part 7] Map problem
- This topic has 70 replies, 4 voices, and was last updated 3 months, 4 weeks ago by MI NI.
-
AuthorPosts
-
September 12, 2024 at 1:09 pm #15816::
This has successfully fixed the problem of being unable to open ESC, inventory, and maps in new games. However, the problem that the Button cannot be triggered on the first map still exists, but the ESC and inventory buttons in other maps can still be used normally.
September 12, 2024 at 1:21 pm #15817September 12, 2024 at 1:27 pm #15818::No, there will be no red error when starting a new game or entering the first map directly.
September 12, 2024 at 1:40 pm #15819::Can you first test if your GameManager.cs is able to sense that your inputs are being pressed by creating print messages through an if statement for the button inputs?
private void Update() { if (Input.GetButtonDown("Map") || Input.GetKeyDown(KeyCode.Escape) || Input.GetButtonDown("Inventory")) { print("Input works") } }
If input doesn’t work, something is wrong with your inputs, or your GameManager encountered an issue in
Awake()
.
If the input is not detected, add a print message to see if everything is loaded in
Awake()
of GameManager.csprivate void Awake() { SaveData.Instance.Initialize(); if(Instance != null && Instance != this) { Destroy(gameObject); } else { Instance = this; } DontDestroyOnLoad(gameObject); SaveData.Instance.LoadSceneData(); SaveScene(); SaveData.Instance.LoadMapData(); savePoint = FindObjectOfType<SavePoint>(); print("Loaded everything"); }
September 12, 2024 at 1:54 pm #15820::Yes, they can detect input, but they still can’t click the button to pause the page or view the inventory content.
September 12, 2024 at 4:55 pm #15821September 12, 2024 at 5:38 pm #15822September 13, 2024 at 3:41 pm #15824September 13, 2024 at 6:24 pm #15825September 13, 2024 at 6:40 pm #15826::In FadeUi.cs, can you try finding the codes that set
canvasGroup.blocksRaycasts
and comment them out?Following that, try setting your “Raycast Target” to false for your scene fader.
When you test out pressing the button and you are unable to.
Do Not Restart but instead looking through the canvas elements and deactivating any of them by settting those game objects inactive.
You should do this to find if any one game object is causing the issue, or if the issue is primarily the buttons.
September 13, 2024 at 7:44 pm #15827 -
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: