Unity 2019.3 - Unlocking the mouse cursor

  Рет қаралды 7,856

Grass Cat

Grass Cat

Күн бұрын

Пікірлер
@mateodemicheli2420
@mateodemicheli2420 4 жыл бұрын
This video it is exactly what I was looking for, and it makes me feel not that bad for not know how to reactivate a cursor. Keep like this and be safe :D
@FLIZTERYT
@FLIZTERYT 3 жыл бұрын
IKR!
@relarin952
@relarin952 11 күн бұрын
Super appreciate you, Spent hours trying to figure out why I couldn't click buttons but not this makes a lot of sense.
@zachguillet9315
@zachguillet9315 4 жыл бұрын
Thank you so much I spent the whole day working on this and you explained it in 6 minutes and 24 seconds
4 жыл бұрын
where did you attack the script
@zachguillet9315
@zachguillet9315 4 жыл бұрын
@ I put it on a empty object
@funnymoondog1xx486
@funnymoondog1xx486 4 жыл бұрын
This is very great and simple. I like how you put it into detail and give it some perspective for viewers to connect to. This is perfect for pretty much any genre of game
@MROCTAGON-uw7ry
@MROCTAGON-uw7ry 7 ай бұрын
this is soooooo use full I've needed this for so long!
@pancakebananasplash
@pancakebananasplash Жыл бұрын
This one was driving me crazy. Thank you.
@RichardFleming
@RichardFleming Жыл бұрын
Glad it helped
@Nathan-cx6et
@Nathan-cx6et 3 жыл бұрын
Man, i love you Too much I started programming not long ago, and i was in despair You deserve so much Sorry for english, I'm Brazilian
@RichardFleming
@RichardFleming 3 жыл бұрын
Your English is 100% better than my Portuguese. Glad I could help.
@Nathan-cx6et
@Nathan-cx6et 3 жыл бұрын
@@RichardFleming thanks kkk
@3d_nahla289
@3d_nahla289 2 жыл бұрын
thanks man , but what if I have two scene , first one need lock cursor and the second beed cursor!!! how can I un lock it ???
@phantomapprentice6749
@phantomapprentice6749 3 жыл бұрын
Thank you , its amazing how I found no mention of this elsewhere.
@kijjamburodney3086
@kijjamburodney3086 2 жыл бұрын
Thank you so much for this. It is definitely a lifesaver for future FPS games i want to make.
@raydartt
@raydartt 3 жыл бұрын
I have been working for a year on my game and was ready to give up (not really). When I added an inventory window I couldn't point to anything. I have been looking for days for an answer and finally I have the solution. I added the code to my inventory window scripts so when i open my inventory window the cursor appears and then disappears when I close the window. Perfect. Thanks Grass Cat.
@RichardFleming
@RichardFleming 3 жыл бұрын
Excellent, glad to hear I could help you get unstuck :)
@AbhimanyuVenu
@AbhimanyuVenu 10 ай бұрын
i dont have main menu script? should i just create a new script and add it to my buttons?
@emilian_spielt300
@emilian_spielt300 2 жыл бұрын
Omg dude i fkn love u so much!!!! i tried 2 million other things but nothing worked. you deserv an prize
@Passenger-vf8pp
@Passenger-vf8pp Жыл бұрын
This video saves my day!
@Passenger-vf8pp
@Passenger-vf8pp Жыл бұрын
Thank you so much for sharing this tip!
@cobrakaiguy6047
@cobrakaiguy6047 2 жыл бұрын
thank you so much i was looking for that exactly thing hours and i finally founded you , its all worked wihtout any problem on my first try THANK YOU SO MUCHHH you got a new like user and subscriber
@snokewatch2048
@snokewatch2048 2 жыл бұрын
Thanks so much!! I have tried to find this for years!
@tiggs_4429
@tiggs_4429 3 жыл бұрын
THANK U SOOOOOOOOOOOOOOOOOOOOOOOOO MUCH! IVE BEED LOOKING FOR SOMETHING FOR OVER TWO MONTHS!
@FC12CGaming
@FC12CGaming 4 жыл бұрын
can you link the script because my one has a error
@matus5422
@matus5422 2 жыл бұрын
using System.Collections; using System.Collections.Generic; using UnityEngine; public class MainMenuUI : MonoBehaviour { // Start is called before the first frame update void Start() { UnlockMouse(); } // Update is called once per frame void Update() { } void UnlockMouse() { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } }
@Tyl8rr
@Tyl8rr Жыл бұрын
It says that "Cursor" does not contain a defenition for lock state :/
@amaxunny7973
@amaxunny7973 3 жыл бұрын
My mouse is flickering why?
@discocat9431
@discocat9431 2 жыл бұрын
WinUI.gameObject.SetActive(true); Cursor.visible = true; Cursor.lockState = CursorLockMode.None; I type these and when my UI gets enabled I can see my cursor but it doesn't unlock. I made another separated script from the player and there it gets unlocked. Weird. Also the cursor blinks
@dark_teddy
@dark_teddy 2 жыл бұрын
God, thank you so much man, I've been trying to figure this out for so long.
@Wa515
@Wa515 3 жыл бұрын
Thank you, but after my cursor becomes visible, the buttons are not pressed :(
@RichardFleming
@RichardFleming 3 жыл бұрын
Unfortunately this could be from a whole host of other issues. The most common mistake I've seen where the buttons stop responding is that the Event System GameObject no longer exists, so you might want to double check for that.
@Wa515
@Wa515 3 жыл бұрын
@@RichardFleming thank you, I've already fixed this
@inquisitive240
@inquisitive240 Жыл бұрын
TOOK ME SO LONG TO FINALLY FIND THISSSSS THANK YOU edit: Wait I'm trying to make a pause menu so what do I do to lock and unlock because I tried doing void LockMouse() { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; } void UnlockMouse() { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } and calling it from different states but when I unpause it doesn't seem to work
@pumpkinisland12
@pumpkinisland12 2 жыл бұрын
It doesn’t work for me, it still just disappears when i click on a button and does nothing
@Sewshy2
@Sewshy2 3 жыл бұрын
thank you sooooooooooo much now u just earnt a new subscriber
@RichardFleming
@RichardFleming 3 жыл бұрын
Glad I could help :)
@KAcs4_pictures
@KAcs4_pictures 3 жыл бұрын
Oooh my inventory button problem solution :o Thank you!
@mayonnaiseguy69420
@mayonnaiseguy69420 Жыл бұрын
This is 10000000% EXACTLY what i was looking for. Thanks man, you are a life saver ❤
@chami_212
@chami_212 Жыл бұрын
Thank u very much i was locked 2 hours on this bug
@RichardFleming
@RichardFleming Жыл бұрын
Glad I could help
@mycomputer2757
@mycomputer2757 3 жыл бұрын
Can link the script?it's giving me errors
@maqsreal
@maqsreal 3 жыл бұрын
me too
@matus5422
@matus5422 2 жыл бұрын
using System.Collections; using System.Collections.Generic; using UnityEngine; public class MainMenuUI : MonoBehaviour { // Start is called before the first frame update void Start() { UnlockMouse(); } // Update is called once per frame void Update() { } void UnlockMouse() { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } }
@jozatheman
@jozatheman 2 жыл бұрын
God bless you man, helped allot
@1___________________1-n6i
@1___________________1-n6i 3 жыл бұрын
whats weird is that my cursor was unlocked from before. one day when i start unity it got locked
@RichardFleming
@RichardFleming 3 жыл бұрын
Odd indeed. If I were to take a guess, it sounds like you added in a component that was locking the cursor. There is no way to tell if a component, or a prefab containing said component, locks the cursor without looking at the code.
@1___________________1-n6i
@1___________________1-n6i 3 жыл бұрын
@@RichardFleming well, this fixed it anyways. so thanks!
@seodev606
@seodev606 4 жыл бұрын
Thank You So Much It Works
@kingbanimation7583
@kingbanimation7583 2 жыл бұрын
thanks man you are a life saver
@TheGrassKing
@TheGrassKing Жыл бұрын
Grass
@alanrenier2786
@alanrenier2786 2 жыл бұрын
Thanks, solved my problem !!!
@computaristgamer
@computaristgamer 7 ай бұрын
Bro man you you you don't know how much this thing help me man you are my bro man thankyou thankyou you save my ass
@vallexti
@vallexti 3 жыл бұрын
This works really awesome! Thanks alot!
@RichardFleming
@RichardFleming 3 жыл бұрын
Glad it helped!
@pirakathiesvfx6188
@pirakathiesvfx6188 Жыл бұрын
Thank You So Much Its Work🙂
@fachri17
@fachri17 4 жыл бұрын
it didnt work for me, it always says"Cursor does not contain bla bla bla. or the name does not exist in the current context. pls help me
@lonr_gsmo4583
@lonr_gsmo4583 4 жыл бұрын
Same here
@funnymoondog1xx486
@funnymoondog1xx486 4 жыл бұрын
Check out your spelling. Maybe you have a lowercase instead of a capital letter or vise versa
@thedevelopingbird2291
@thedevelopingbird2291 3 жыл бұрын
Thanks! Needed this
@RichardFleming
@RichardFleming 3 жыл бұрын
Your welcome, glade it helped you out.
@Pointless-Content
@Pointless-Content Жыл бұрын
THANK YOU SO MUCH!!!! I JUST SUBBED!
@FLIZTERYT
@FLIZTERYT 3 жыл бұрын
POG!
@shanickcuello7123
@shanickcuello7123 4 жыл бұрын
Solution at 4:44
@RichardFleming
@RichardFleming 4 жыл бұрын
True, but I do feel the context adds a bit for new developers :)
@z11py
@z11py 2 жыл бұрын
omg, thanks so much!
@firefoxlive1912
@firefoxlive1912 Жыл бұрын
Thank You!
@saaduff4257
@saaduff4257 3 жыл бұрын
THANK YOU VERY VERY MUCH!!!
@RichardFleming
@RichardFleming 3 жыл бұрын
You're welcome!
@antitroll-j8s
@antitroll-j8s 3 жыл бұрын
Helps so much ty
@RichardFleming
@RichardFleming 3 жыл бұрын
Glad I could help :)
@hamezhmz
@hamezhmz 4 жыл бұрын
doesn't work
@Grifff-iw9bd
@Grifff-iw9bd 3 жыл бұрын
Thank you SO SO much
@RichardFleming
@RichardFleming 3 жыл бұрын
You're welcome!
@nikname2560
@nikname2560 2 жыл бұрын
thx for the help
@dunderguy
@dunderguy 2 жыл бұрын
Thanks :)
@wicksley
@wicksley 11 ай бұрын
Thank you :)
Unity 2020.2 - Introduction to Editor Windows
18:03
Grass Cat
Рет қаралды 60
I Wish I Had Known This Before I Started Unity Game Development...
11:11
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Custom Cursor with Input System - Unity Tutorial
10:40
samyam
Рет қаралды 25 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 761 М.
Unity Pause Tutorial: Best Practices to Pause Your Game the Right Way
5:49
Sasquatch B Studios
Рет қаралды 12 М.
Unity PAUSE MENU 2022 Tutorial | Beginner Friendly
14:57
GarrettDeveloper
Рет қаралды 16 М.
How to: Virtual Mouse with Gamepad (Input System Unity Tutorial)
25:09
Unity - Scene Loading Dark - Lighting Is too dark - FIX
8:25
Online Code Coaching
Рет қаралды 26 М.
6 Minute PAUSE MENU Unity Tutorial
6:09
BMo
Рет қаралды 123 М.
5 Golden Rules of Game Cards Graphic Design You MUST OBEY
11:27
Dave Jeltema
Рет қаралды 164 М.