Jump to content
1 hour ago, Agena_ said:

i have a car game, with main menu and a level. 

 

both have differnet music, when im on the game, and hit "esc" and main menu, the level sound and main menu soudn play together. how can i stop the level sound?

 

i was using this tutorial 

 

 

thank you

You need to write a script that will open the menu and pause the game at the same time

A PC Enthusiast since 2011
AMD Ryzen 7 5700X@4.65GHz | GIGABYTE RTX 3080 GAMING OC | 4x 8GB Micron Rev.E (D9VPP) 3800MHz 16-19-14-21-58
Link to comment
https://linustechtips.com/topic/1356903-music-issue-in-unity/#findComment-14875014
Share on other sites

Link to post
Share on other sites

1 hour ago, Vishera said:

You need to write a script that will open the menu and pause the game at the same time

a.png.39f799b9ae131078f0e77114a2a881b7.png

This is how my button looks for the menu button, when you click 'esc' in game.

 

 

1581567869_Screenshot(158).png.e56ef042f1fd09f01d0ed961156f684f.png

these are the options i have, from the tutorial. 

which option can i use to add a click, to stop the level?

 

thanks

Link to comment
https://linustechtips.com/topic/1356903-music-issue-in-unity/#findComment-14875145
Share on other sites

Link to post
Share on other sites

1 minute ago, Agena_ said:

these are the options i have, from the tutorial. 

which option can i use to add a click, to stop the level?

 

thanks

You will have to code it

A PC Enthusiast since 2011
AMD Ryzen 7 5700X@4.65GHz | GIGABYTE RTX 3080 GAMING OC | 4x 8GB Micron Rev.E (D9VPP) 3800MHz 16-19-14-21-58
Link to comment
https://linustechtips.com/topic/1356903-music-issue-in-unity/#findComment-14875150
Share on other sites

Link to post
Share on other sites

10 minutes ago, Agena_ said:

im a newbie, do you know what to do? or any tutorials i can use

Can you post the script you are using?

A PC Enthusiast since 2011
AMD Ryzen 7 5700X@4.65GHz | GIGABYTE RTX 3080 GAMING OC | 4x 8GB Micron Rev.E (D9VPP) 3800MHz 16-19-14-21-58
Link to comment
https://linustechtips.com/topic/1356903-music-issue-in-unity/#findComment-14875161
Share on other sites

Link to post
Share on other sites

6 minutes ago, Vishera said:

Can you post the script you are using?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class SceneSelect : MonoBehaviour
{
    public void LoadScene(string sceneName)
    {
        SceneManager.LoadScene(sceneName); 
    }
}

 

this is the sceneselect script i dragged to the main menu button, and resume button in  a level

 

image.png.9febd8f828ad116279e68e274772d65f.png

Link to comment
https://linustechtips.com/topic/1356903-music-issue-in-unity/#findComment-14875163
Share on other sites

Link to post
Share on other sites

5 minutes ago, Agena_ said:

this is the sceneselect script i dragged to the main menu button, and resume button in  a level

 

I need to see the script that opens the menu,and there i can add the pause function.

But this script you quoted just loads a scene.

A PC Enthusiast since 2011
AMD Ryzen 7 5700X@4.65GHz | GIGABYTE RTX 3080 GAMING OC | 4x 8GB Micron Rev.E (D9VPP) 3800MHz 16-19-14-21-58
Link to comment
https://linustechtips.com/topic/1356903-music-issue-in-unity/#findComment-14875176
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×