Forum begins after the advertisement:


[Part 9] UI Menu ParticleSystem not showing

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 9] UI Menu ParticleSystem not showing

Viewing 20 posts - 1 through 20 (of 22 total)
  • Author
    Posts
  • #17759
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    first my particle not show second my option menu not showing when clicked

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

    For the particle issue, try setting the Sorting Layer of the Particle System’s Renderer to 1 or change the layer from Default to another layer.

    For the options menu not showing, ensure that you have disabled the Main Menu and correctly duplicated the Main Menu panel, removing all UI elements before adding the new options.

    Could you provide more details about how you implemented the options menu?

    #17761
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    my particle still can’t showing when running

    and this how i implement my menu

    View post on imgur.com
    #17762
    Ser Apustaja
    Level 6
    AI Assistant
    (BETA)
    Helpful?
    Up
    0
    ::

    Try setting the Sorting Layer of the Particle System’s Renderer to 1 or change the layer from Default to another layer.

    Can you confirm if you have followed the steps to disable the Main Menu before implementing the Options Menu?

    #17769
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    i have settings particle layer to 1 and disable main menu beforing implement option menu

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

    It sounds like you’ve done some troubleshooting already. Here are a few more things you can check to help with the particle system and the options menu:

    1. Particle System Settings:

      • Ensure that the “Play On Awake” option is checked in the Particle System component.
      • Check if the Particle System is set to loop if you want it to continuously display.
    2. Camera Settings:

      • Make sure the camera is positioned correctly to see the particles. Sometimes if the camera is not facing the right direction or if the particles are behind the camera, they won’t be visible.
      • Check the camera’s culling mask to ensure it includes the layer that your particle system is on.
    3. Particle System Emission:

      • Verify that the emission rate is set appropriately. If it’s too low, particles might not be emitted visibly.
    4. Options Menu:

      • Double-check that the Canvas for your Options Menu is set to ‘Screen Space – Overlay’.
      • Make sure the Options Menu is set to active when you click the button to show it. You can use menu.SetActive(true); in your code.
      • Ensure there are no overlapping UI elements that might be blocking the Options Menu from being clickable.

    If you provide the code you’re using to toggle the options menu, I can help you troubleshoot that part specifically!

    #17771
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    i have try your suggestion but its not working

    View post on imgur.com
    #17772
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    okay i will try this

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

    It looks like the images in your link might not be visible to me. However, let’s try a few more troubleshooting steps:

    1. Particle System Visibility:

      • Check if the Particle System component is enabled.
      • Ensure the Particle System is not being destroyed or disabled elsewhere in your code.
    2. Debugging the Options Menu:

      • Ensure your button that triggers the options menu is set up correctly and has an event listener attached to it.
      • You might want to add a print statement or log to see if that part of your code is being executed when you click the button. For example:
        public void ShowOptionsMenu() {
            Debug.Log("Options Menu Button Clicked");
            optionsMenu.SetActive(true);
        }
    3. Check Hierarchy:

      • In the Unity hierarchy, ensure the Options Menu is a child of the Canvas and that it is not set to inactive in the inspector.
    4. Event System:

      • Ensure that there is an EventSystem object in your scene. This is required for UI elements to work properly.

    If you can share any snippets of the code you use to toggle the menu or any error messages in the console, it would help narrow down the issue further!

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

    @nabilgaming when the game is playing, go to the Scene view and double click on the Particle System. This will cause Unity to zoom into the particle system, so you can see where it is. Oftentimes, you will find it is positioned or sized in such a way that it is difficult to see.

    Can you do this and show me what you see?

    #17777
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    that still not working

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

    I’m sorry to hear that you’re still facing issues. Let’s go over a checklist to ensure everything is set up correctly:

    Particle System:

    1. Play On Awake: Make sure “Play On Awake” is checked.
    2. Renderer: Check the Renderer component of the Particle System and ensure that the Sorting Layer is set correctly to be above other layers.
    3. Emission: Ensure the emission rate is set to a value greater than zero.
    4. Scale: Make sure that the Particle System is not scaled down to zero in the Transform component.
    5. Camera: Check if the camera can see the Particle System. You can try moving the camera closer to see if that helps.

    Options Menu:

    1. Button Setup: Ensure the button is wired up correctly to the function that shows the options menu.
      public void OnOptionsButtonClick() {
          optionsMenu.SetActive(true);
      }
    2. Canvas: Verify that the Options Menu is part of the Canvas and that the Canvas is set to “Screen Space – Overlay.”
    3. Hierarchy: Check the hierarchy to ensure the Options Menu is not nested under another UI element that might be blocking it.
    4. Events: Make sure there’s an Event System in the scene. If it’s missing, right-click in the Hierarchy, go to UI, and select Event System.
    5. Debugging: Add debug statements in your button click method to confirm if it is being triggered when you click the button.

    Additional Help:

    If none of these suggestions work, please share the following:

    • The code you are using to toggle the options menu.
    • Any error messages you might see in the console.
    • A brief description of how your hierarchy looks in Unity.

    This information can help identify what’s going wrong!

    #17779
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::
    #17780
    Ser Apustaja
    Level 6
    AI Assistant
    (BETA)
    Helpful?
    Up
    0
    ::

    I can’t view the images directly, but I can still help! If you could describe what the hierarchy looks like or any key components in your Unity setup, that would be beneficial.

    Additionally, please provide any relevant code snippets you’re using for the particle system and options menu. This way, we can better identify any potential issues together!

    Let’s ensure we cover the following:

    1. Particle System: Describe how it’s set up in the hierarchy.
    2. Options Menu: Describe the button setup and what code is executed when you attempt to show it.
    3. Console Errors: Are there any errors or warnings in the console when you run the game?

    With this information, I can give you more targeted advice!

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

    @nabilgaming set the z-coordinate of your particle system GameObject to 0. Right now, it is on the same location as the camera, so it cannot be seen by the camera (i.e. does not show up).

    View post on imgur.com
    #17783
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    okay its working thank you.but however with my option menu?

    #17784
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    okay its working thank you.however with my option menu?

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

    I’m glad to hear that the particle system is now working! For your options menu, let’s ensure everything is functioning as intended.

    1. Menu Activation: Make sure the options menu is activated correctly when the corresponding button is clicked. Use the following code:

      public GameObject optionsMenu; // Assign this in the inspector
      
      public void OnOptionsButtonClick() {
          optionsMenu.SetActive(true);
          Debug.Log("Options Menu Activated");
      }
    2. Closing the Menu: If you want to add functionality to close the options menu, ensure you have a button that calls a method to deactivate it:

      public void CloseOptionsMenu() {
          optionsMenu.SetActive(false);
          Debug.Log("Options Menu Closed");
      }
    3. Menu Interactions: Ensure the buttons inside the options menu are set up correctly. They should have their onClick events assigned to the functions that handle their specific actions (e.g., adjusting settings, returning to the main menu).

    4. UI Elements: If you have sliders, toggles, or dropdowns in the options menu, make sure they are set up to update the relevant settings properly. For example, if you have a volume slider:

      public void SetVolume(float volume) {
          AudioListener.volume = volume;
          Debug.Log("Volume set to: " + volume);
      }
    5. Debugging: If the options menu isn’t working as expected, add Debug.Log statements at key points in your code to track what’s happening when you attempt to interact with it.

    If you can specify what isn’t working with the options menu or what features you want to implement, I can provide more targeted assistance!

    #17786
    Pool ForReal
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    I use FadeUI script likes the video this my script

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class FadeUI : MonoBehaviour
    {
        CanvasGroup canvasGroup;
    
        private void Awake()
        {
            canvasGroup = GetComponent<CanvasGroup>();
        }
    
        public void FadeUIOut(float _seconds)
        {
            StartCoroutine(FadeOut(_seconds));
        }
        public void FadeUIIn(float _seconds)
        {
            StartCoroutine(FadeIn(_seconds));
        }
    
        IEnumerator FadeOut(float _seconds)
        {
    
            canvasGroup.interactable = false;
            canvasGroup.blocksRaycasts = false;
            canvasGroup.alpha = 1;
            while (canvasGroup.alpha > 0)
            {
                canvasGroup.alpha -= Time.unscaledDeltaTime / _seconds;
                yield return null;
            }
            yield return null;
        }
    
        IEnumerator FadeIn(float _seconds)
        {
            canvasGroup.alpha = 0;
            while (canvasGroup.alpha < 0)
            {
                canvasGroup.alpha += Time.unscaledDeltaTime / _seconds;
                yield return null;
            }
            canvasGroup.interactable = true;
            canvasGroup.blocksRaycasts = true;
            yield return null;
        }
        // Start is called before the first frame update
        void Start()
        {
    
        }
    
        // Update is called once per frame
        void Update()
        {
    
        }
    }
    
    #17787
    Ser Apustaja
    Level 6
    AI Assistant
    (BETA)
    Helpful?
    Up
    1
    ::

    It looks like there are a couple of issues in your FadeUI script that might be causing problems with the fade-in functionality. Specifically, in the FadeIn coroutine, the condition in the while loop should check if canvasGroup.alpha is less than 1, not less than 0. Here’s the corrected version of your FadeIn method:

    IEnumerator FadeIn(float _seconds)
    {
        canvasGroup.alpha = 0;
        while (canvasGroup.alpha < 1) // Change this condition
        {
            canvasGroup.alpha += Time.unscaledDeltaTime / _seconds;
            yield return null;
        }
        canvasGroup.interactable = true;
        canvasGroup.blocksRaycasts = true;
        yield return null;
    }

    Make sure to update that condition, and it should work as expected.

    If you have any further questions or if there's something specific that isn't working with the fade effects, please let me know!

      1 anonymous person
    has upvoted this post.
Viewing 20 posts - 1 through 20 (of 22 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: