Forum begins after the advertisement:
[Part12] Regarding some operational issues in the article
Home › Forums › Video Game Tutorial Series › Creating a Metroidvania in Unity › [Part12] Regarding some operational issues in the article
- This topic has 46 replies, 4 voices, and was last updated 2 days, 20 hours ago by Terence.
-
AuthorPosts
-
December 22, 2024 at 4:33 pm #16875::
Hi, I just tried to do the content of Part 12, but I encountered a little problem when I did it.
First is the part d. Making the Main Menu responsive I’m not sure how to operate this part. Dragging my screen like in the article will not change the size of my screen, but maintain a certain scaling ratio. I’m not sure if this part will have an impact on my next operation, but I didn’t do this part.
Next is part f. Quality-of-life notification to the UIScreen inspector. I’m not sure how to do this part, I set OptionsMeun and CreditMenu to inactive but it still won’t show up, I’m not sure what the problem is.I recorded a video showing the problem I encountered
December 22, 2024 at 5:11 pm #16876::Hi Mini,
For part d, making the Main Menu responsive, it sounds like you might be encountering an issue with the responsiveness of your website when resizing the screen. It’s important to ensure that your CSS is properly set up to handle different screen sizes using media queries. You can define different styles for different screen sizes to make your website responsive.
As for part f, it seems like you’re having trouble with setting the OptionsMenu and CreditMenu to inactive in the UIScreen inspector. Double-check that you are correctly referencing these elements and that they are set up to be activated or deactivated as needed. It’s also important to make sure that any
December 23, 2024 at 11:53 am #16885::Have you assigned the
Activate()
function to the buttons? You need to assign OptionsMenu.Activate() to the Options button, and Credits.Activate() to the Credits button.December 23, 2024 at 12:11 pm #16890December 23, 2024 at 1:11 pm #16893December 23, 2024 at 5:58 pm #16894December 23, 2024 at 6:31 pm #16895::seems that the code in the article does not have
OptionMenu.Activate()
to call, or I can just selectActivate()
directly. I’m not sureI tried calling Activate(), but it only fades in and out, and no other UI interface appears. Maybe I need a picture, or more detailed instructions on how to operate this part, because it seems not to be mentioned in the article.
View post on imgur.com
December 24, 2024 at 3:11 pm #16900December 24, 2024 at 5:49 pm #16901::I’m sorry, but I still don’t quite understand how to operate the whole step. I recorded the video as a reference. Did I miss anything?
December 24, 2024 at 6:11 pm #16902::Hello MI NI,
I’m sorry, but as a text-based bot, I can’t view videos. Could you please provide a brief description or summary of the issue you’re facing? I’ll do my best to assist you with your programming problem.
December 25, 2024 at 2:03 pm #16908::@mini you need to assign the Activate function from OptionsMenu GameObject to the options button, and from the CreditsMenu GameObject to the credits button. You’ve assigned the Activate function from MainMenu instead, so the button is re-activating the main menu.
View post on imgur.com
December 26, 2024 at 8:50 pm #16918::I had a problem with the sound effect of the button. I added
UIAudioFeedbackConfig
according to the article. and removedUIAudio
, but the sound effect doesn’t appear, I don’t know if I missed any steps. The recording sound was a bit low, but the buttons did not make any sound. In addition, I found that the First Selected function made the direction keys lose their function after I clicked on an open space. I don’t know if it is normal.In addition, because I am used to making steps, I have only briefly read the following content, so I am not sure how to set up the conversion from
MainMenu
toStage_1
. Just like the picture in front of me, there seems to be no function that can be called in the currentUIScreen
.December 26, 2024 at 9:11 pm #16919::Hello Mini,
It seems like you’re facing a few issues with the sound effect of the button, the behavior of the First Selected function, and setting up the conversion from
MainMenu
toStage_1
. Let’s break it down:-
Sound Effect Issue: When you added
UIAudioFeedbackConfig
and removedUIAudio
, the sound effect didn’t appear, and the recording sound was low. Check if the sound files are correctly linked and if the volume levels are set appropriately in the configuration. -
First Selected Function Issue: The behavior where the direction keys lose their function after clicking on an open space
December 26, 2024 at 11:18 pm #16921::Let’s add a few debug lines into your
PlayAudioFeedback()
function, and try clicking on the buttons again.Do the messages show up on the Console?
public void PlayAudioFeedback(string type) { print("PlayAudioFeedback called"); // Don't play any feedback if there is no audio source or feedback config assigned as well. // This prevents NullReferenceExceptions from occurring. if (!audioSource || !feedbackConfig) return; print("PlayAudioFeedback fired"); // Play the sound if we find a valid SFX. AudioClip sfx = feedbackConfig.GetSound(type); if(sfx) audioSource.PlayOneShot(sfx); }
One thing to take note of is to see whether “PlayAudioFeedback fired” appears in the Console. If it doesn’t, it means that your
UIScreen
is unable to find either anaudioSource
orfeedbackConfig
.December 27, 2024 at 12:24 am #16922 -
-
AuthorPosts
- You must be logged in to reply to this topic.