This channel is so underrated. This is easily the best Unity tutorial channel for beginners on KZbin.
@samyam4 жыл бұрын
Glad you like it :)!
@brainwavestobinary4 жыл бұрын
I agree. Cool thing is that the channel has more than doubled subscribers in the last 30 days (according to SocialBlade), so people are noticing. Hopefully it keeps up.
@samyam4 жыл бұрын
Thank you! 😁
@BarcelonaMove2 жыл бұрын
I love how she moves the mouse around the thing while explaining it. It shows a lot of enthusiasm about the topic.
@samyam2 жыл бұрын
Some people were complaining about it so I’ve stopped doing it as much in my more recent videos 🤣 Glad someone liked it!
@MasonWolf906 ай бұрын
Thanks! I have watched so many different videos and none of them worked, but this video was straight to the point.
@kamranbigdely2 жыл бұрын
Thanks!
@samyam2 жыл бұрын
Thanks so much for the donation!! :D
@CrunchyClub20204 жыл бұрын
If you get a "Can't add script error" it's because line 5 of the code after "public class" needs to be the same name as whatever the script is. This is my second day of unity and I renamed the script after I made it so the names didn't match. Awesome video, thanks for NOT including 10 minutes of fluffy BS.
@uhhhhh2672 Жыл бұрын
If you get an error message like me that says "`Cursor' does not contain a definition for `SetCursor'" its because you named your script "Cursor". Was banging my head against the wall trying to figure it out. Dont be like me, name your script appropriately lmao
@ceciliacecchet5869 Жыл бұрын
same here, but I named the input control "cursor"
@pineneedle1168 ай бұрын
I did neither of these and am having the same issue?
@anaribeiro94713 жыл бұрын
This is the best tutorials I have seen for UNITY. Well done! And thank you so much for this great content.
@samyam3 жыл бұрын
Thank you!! 😄
@moandtell3 жыл бұрын
Thank you so much for this video! I've learned so much in just the first half alone! This is my first step to building a game, and it feels really good to see something actually working when I press play!
@kaloshabuthapa32842 жыл бұрын
When writing script, for start function, 7:47, controls.Mouse.Click.started, my script has error: “CursorControl does not contain a definition for “Mouse” . There was an option for MouseActionMap, are they the same ? How to fix this error?
@Klash1202 жыл бұрын
I'm stuck at that part too :x
@Klash1202 жыл бұрын
Figured it out right as I left a comment! I was using my own naming for variables & such, User error! If you've done the same, check your input action naming. Name of variable you've set (control), Action Map name (mouse), and Action (Click). Control.mouse.click; If you use the default mapping that Unity makes, it'll be [your variable name].Player.click. Hope that helps~
@camillatomasetti24535 ай бұрын
@@Klash120 i have the same problem, but I don't quite understand what do you mean 😅 can you try to explaine better? Thank you!
@starwarsfan68682 жыл бұрын
Thank u so much for this video!!! It helps soooo much! You're really a good teacher!!!
@samyam2 жыл бұрын
Thank you so much!! Appreciate it 😁
@starwarsfan68682 жыл бұрын
The click doesnt work by me. There are no errors, but it just doesnt work! Any ideas why???
@georgigeorgiev55242 жыл бұрын
Thank you so much I needed this type of tutorial =D
@angiemon8972 ай бұрын
How do I make the cursor scale correctly with different resolutions? :(
@mantavisions23623 жыл бұрын
THANK YOU! this saved me, i was struggling! haha
@grimonmilk72872 жыл бұрын
I get this error code when I try this "Assets\Pixel Cursors\CursorController.cs(24,6): error CS1513: } expected"
@alphaanar26514 жыл бұрын
YAY! new video that explains stuff which l have no idea what is this :D
@vinipossatto95864 жыл бұрын
Nice video!
@chloefinlay91333 жыл бұрын
This is such a great and clear tutorial! I'm just wondering (as I am new to unity) if there's a way I can use this method to click my objects but also use the mouse to look around the environment also? Thank you for any help you can give :)
@samyam3 жыл бұрын
Awesome! Yes I have a follow up video for clicking kzbin.info/www/bejne/gHqnaIyXfaangaM and I have a video on panning and zooming around the scene with cinemachine kzbin.info/www/bejne/hqSkk3uld51onq8 And then if you want to bound your camera movement to a certain space here is another video kzbin.info/www/bejne/n6vYnouhYt2ie68 Lots of videos 😂
@chloefinlay91333 жыл бұрын
@@samyam Thank you so so much!
@klause2s Жыл бұрын
i have been informed by unity that "'Texture2D' does not contain a definition for 'SetCursor' and no accessible extension method 'SetCursor' accepting a first argument of type 'Texture2D' could be found (are you missing a using directive or an assembly reference?)" can you provide assistance? would be appreciated
@IronIsFun Жыл бұрын
Same issue, don't know how to fix it. Did you find a solution
@klause2s Жыл бұрын
i have not, i've since moved away from unity and toward gamemaker
@t33h33studio5 ай бұрын
Unfortunately, SetCursor is unusable for me. At first I thought I made a bug, but SetCursor simply does not change my cursor at times. I am not alone in this issue as people have stated this function to be unreliable for years. The OS wants to fight Unity for control.
@HdmiFly2 жыл бұрын
My imported cursor only appears once I hit escape. Any ideas?
@rbanister1004 жыл бұрын
the buDIN, as opposed to button
@jianingzhuang1043 жыл бұрын
Nice video! May I ask if we can resize the cursor using script? Thanks.
@samyam3 жыл бұрын
32x32 texture for cursor is required, however according to this forum you can possibly resize the actual pixels of the texture: forum.unity.com/threads/cursor-size.288333/#:~:text=If%20you%20want%20to%20resize,is%20just%20taking%20up%20memory. Or you can ignore this method and have an empty gameobject with a sprite cursor and have that follow your mouse movement
@jianingzhuang1043 жыл бұрын
@@samyam Thank you very much!
@fluorescente2 жыл бұрын
silly question here but... how to make a 3D object automatically rotating like an idle state?
@samyam2 жыл бұрын
so rotate around the y axis? In the update method you can call RotateAround similar to the example here docs.unity3d.com/ScriptReference/Transform.RotateAround.html
@fluorescente2 жыл бұрын
@@samyam thank you! I knew it had to be easy! I'm just new to Unity ^_^
@fernandomilans84444 жыл бұрын
hi, i was thinking of changing my project's implementation of inputs to 'input system', but is it worth it? I say, 'input system' is in version 1.0, so I imagine there will be annoying bugs, I saw the documentation but I do not realize the great advantages over doing it the 'traditional' way. What is your opinion at the time of practice, what 'great advantages' you see in 'input system'. Thanks, and very good videos, greetings!
@samyam4 жыл бұрын
I recommend it, super simple to set up and you can easily change controls for different systems as well as allow multiple controls for one action.
@kaydnshepard81314 жыл бұрын
I changed this Input System and my whole Game crashed. Now reinstalling Unity and hope that I can fix this =/ but anyway I learned how to change my curser.
@samyam4 жыл бұрын
😅 remember to back up your project!
@kaydnshepard81314 жыл бұрын
@@samyam yeah sure 😋, lesson learned. But I will see it as a second chance to start my game new with better codes and graphics. I was not that far with the game 🖖🏼
@iamnotcreativeenoughforana58753 жыл бұрын
Can anyone help me? I'm trying to lock the cursor in the middle of the screen with having it stay visible, is there a way to do this?
@samyam3 жыл бұрын
Hm why would you want to do this? It’ll make the player feel as if they can’t move the mouse. To lock it in the middle you can use Cursor.lockState = CursorLockMode.Locked; And if you want something to show in the middle you can add a sprite to the center of the screen
@functionSam3 жыл бұрын
For using a mouse cursor in a menu system, would "release only" be suitable? I'm trying to create a mouse interaction that feels "natural" (at least in a menu to start)
@samyam3 жыл бұрын
Yes I think release would be suitable, you can always test or ask someone to test to see how it feels.
@roland_art4 жыл бұрын
Useful, thanks! If I can, how change (overlay) the color of cursor with c# script?
@samyam4 жыл бұрын
You could either take in another texture with the color you want or you'd have to change the color by going through each pixel of the texture 2d and changing the tint. gamedev.stackexchange.com/questions/124463/changing-some-color-of-a-texture-using-c-in-unity If you only have a mouse in your GUI you can apply a global GUI tint to change the color at that moment forum.unity.com/threads/dynamical-color-change-of-mouse-pointer.166366/
@roland_art4 жыл бұрын
@@samyam Thank you!
@vladimirgalkin4123 жыл бұрын
Please. how to add trail effect on mouse cursor?
@samyam3 жыл бұрын
I show how to do a similar effect here: kzbin.info/www/bejne/jobbkISif9WXZq8 Basically add the trail renderer to a gameobject, then move the gameobject according to where the mouse is
@OutCold9te63 жыл бұрын
I tried again with the Kenny assets and still nothing.
@OutCold9te63 жыл бұрын
I just got it to work by restarting Unity. Does that mean Unity bugged out?
@samyam3 жыл бұрын
Maybe! Sometimes restarting fixes bugs and some issues
@OutCold9te63 жыл бұрын
I tried this with a new 2d sprite, gave it type cursor , compression none, and set it as my cursor object's Cursor variable, and it didn't change my cursor.
@samyam3 жыл бұрын
Did you make sure to attach the script to a gameobject? Also try calling the SetCursor in the Start method instead to see if that helps.
@UnGaming-eh7ht4 жыл бұрын
Honestly curious what color theme you're using for vs code here
@samyam4 жыл бұрын
I'm using the Godot color theme 😂
@animationspace85504 жыл бұрын
Unity says I have no definition for "SetCursor" or "lockState" can you help out or let me have a finished scripted (my code barely comes out right)
@samyam4 жыл бұрын
Make sure you are putting Cursor.SetCursor and Cursor.lockState. The code is available for patrons in the description.
@HadiExtreme4 жыл бұрын
Oh I had this problem last month! If you haven't solved it already, check your script name. If you named it Cursor, then it would be overriding Unity's Cursor class, causing the problem.
@CodeWithMilk2 жыл бұрын
@@HadiExtreme It was the excatly problem I had... thx!
@crusader19104 жыл бұрын
My cursor is only pixels or a disstroted image. Any idea why?
@samyam4 жыл бұрын
It has to do with your import settings on the image. Make sure it is set to Texture2D for type and you can adjust the compression and filtering as well
@SankalpParab3 жыл бұрын
how to interact with world space ui in cursor lock mode
@samyam3 жыл бұрын
That’s a little tricky it seems, you’ll have to simulate the mouse cursor if you lock it to see what UI it is over. You can also shoot raycasts and have the UI with colliders to detect if the ray hits the button. Here’s some threads that may help forum.unity.com/threads/world-space-canvas-cursorlockmode-locked-incompatible.566485/ forum.unity.com/threads/fake-mouse-position-in-4-6-ui-answered.283748/?_ga=2.160872958.255425762.1618484813-653284547.1617361468 stackoverflow.com/questions/38054706/alternative-of-raycast-for-ui-items-in-unity3d stackoverflow.com/questions/42384658/unity-ui-interacting-with-worldspace-ui-when-cursor-is-locked
@SankalpParab3 жыл бұрын
@@samyam thank you so much for your suggestions ✌🏻😇
@eggwardosteve3 жыл бұрын
It really feels like the video went way too fast. It was really hard to keep up, even with having to pause the video
@samyam3 жыл бұрын
Sorry about that! I’ve been improving my pacing and speed in my more recent videos. Thanks for pointing it out!
@Swatgoezhigh3 жыл бұрын
controls.Enable(); and Disable() throws a NullReferenceException
@samyam3 жыл бұрын
Did you instantiate the controls? controls = new CursorControls();
@Swatgoezhigh3 жыл бұрын
@@samyam ok that helped :D
@srecky78223 жыл бұрын
why does unity change the way their code works every 2 seconds? this tutorial doesn't work anymore
@samyam3 жыл бұрын
What do you mean? It should work. What issue are you having?
@fernandomilans84444 жыл бұрын
Hi! In the console it throws me-> InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings. and is because i have in many sides -> Input.GetMouseButtonDown(0), so only solution is Setting Active Input Handling to "Both"?
@samyam4 жыл бұрын
Yes you should only be using the new input system if you enabled it, but you can switch to both to disable the errors
@Baby_Kangaroo434 жыл бұрын
finally smthn useful
@14DimensionEnterprise4 жыл бұрын
why you circling mouse cursor? too annoying
@samyam4 жыл бұрын
Yeah I know I need to work on that 😅 I don’t notice when I record