Unity with James: Pausing a game
Uploader Comments (Envatio)
All Comments (18)
-
Can you re-post your code in your video description. Great tutorial, but it would be helpful to zoom in on the code your writing, its far to blury.
-
@joskesnel You have to reference the mouse look script on your player and disable it. Code example:
var Player = GameObject.Find("Player");
var MouseLookScript = Player.GetComponent("MouseLook
"); MouseLookScript.enabled = false;
-
@Envatio hey i have problem i do wath you do but im making a fps game en wen i pres p the came pause
but i can still look around how can i fix that becouse its annoying if you want to click on somthing xD
-
it took me so long just to find a tutorial on how to pause in unity
-
Not sure I understand. You want to use the mouse or you want to disable it?
If you want to disable the mouse that's a bit tricky. You have to reference the mouselook script attached to the camera, and then set it to false.
var Cam = GameObject.Find("Main Camera"); //Grab the camera
var MouseLookScript = Cam.GetComponent("MouseLook"); Ref the script
If(Paused == true){ MouseLookScript.enabled = false;
}
-
Another question, is it possible to release the mouse? So theres no movement, so I could for example have a menu in pause screen. perhaps a Release.mouse or similar?
It don't work
82jomomma 1 day ago
@82jomomma could you either send me your code or tell me how it doesn't work? This was made in Unity version 2. It may need an update. thx
Envatio 17 hours ago in playlist Uploaded videos
Could you translate this into C# for people who do not know Javascript? i know that they are fairly similar but as a beginner programmer i am unsure of how to change the syntax. if you could do this that would be great.
poolboy11120 4 months ago
@poolboy11120 unfortunately I am not currently well versed in C# but I will look into it, otherwise there may be someone in unity forums that can help you with that.
Envatio 4 months ago