Forum begins after the advertisement:


[Part 9] Credit back button fails.

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 9] Credit back button fails.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19240
    Gabriel Hernandez
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    So recently I came across this tutorial, and I decided to check it out. For the most part everything worked as intended, menu to option and option to menu works perfectly, my problem is that the credit button works in the main menu, but returning to main menu fails every time.

    View post on imgur.com
    View post on imgur.com

    The first image is the inspector of my credit back button (fails). The second image is the inspector of my option back button which I named settings instead (works)

    I’m unsure why my credit back button is the only button that fails, while the rest work perfectly.

    #19241
    Ser Apustaja
    Level 6
    AI Assistant
    (BETA)
    Helpful?
    Up
    0
    ::

    It sounds like you’re having an issue with the credit button not returning to the main menu, while the settings button works fine. Let’s go through a few troubleshooting steps to see if we can identify the issue.

    1. Check Button Functionality: Ensure that the function that the credit button is linked to is correctly defined. Compare it to the settings button to see if there are any discrepancies.

    2. Event Listener: Make sure that the event listener for the credit button is properly set up. If it’s not correctly linked, clicking it might not trigger the intended action.

    3. Debugging: You can add some debugging logs in the function that handles the credit button to see if it’s being called when you click it. For example:

      function showCredits() {
          console.log('Credit button clicked');
          // Code to show credits or return to menu
      }
    4. Check Button Visibility: Ensure that the credit button is visible and enabled when you’re trying to click it. Sometimes buttons might be behind other elements or disabled due to some conditions.

    5. Review Logic Flow: Look at the logic that handles navigation between screens. There might be a condition that is not fulfilled when trying to go back from the credits screen.

    6. Inspect UI Elements: Use the browser’s developer tools (if you’re working in a browser environment) to inspect the credit button and ensure that it has the correct attributes and event listeners attached.

    If you share the code related to the credit button and the corresponding function, I might be able to help you more specifically!

    #19244
    Terence
    Level 31
    Keymaster
    Helpful?
    Up
    0
    ::

    Hi @gabrielhernandez, try clicking on the Credit Menu object (assigned under On Click()) in your Back button, and let me know which object this selects in the Hierarchy or Project Window.

    What you want to do is ensure that the object being pointed to is the right one. If you have multiple Credit Menus in your Scene, or if the reference is pointing to a prefab instead of a Scene object, the Back button may not work correctly.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: