HOW TO CUSTOMIZE YOUR MOUSE CURSOR - UNITY TUTORIAL

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024

Комментарии • 206

  • @Blackthornprod
    @Blackthornprod  6 лет назад +74

    Hope my voice sounds okay :) ! If it seems a little strange it's because I had cold at the time of recording :) !

    • @chinyonglim7624
      @chinyonglim7624 6 лет назад +1

      Noa~thank so much~!!!
      The video is ok~
      Please take care of your health~ :)

    • @Blackthornprod
      @Blackthornprod  6 лет назад +3

      I'm already feeling a lot better :) ! The cold is almost gone !

    • @bunggo9914
      @bunggo9914 6 лет назад +1

      nah your voice is fine...

    • @ThomasEngebretsen90
      @ThomasEngebretsen90 6 лет назад +1

      Voice sounds fine :) Although, I've noticed in quite a few of your videos that it sounds like you record your voice a bit too hot. In other words, it sounds like it's clipping every now and then. Other than that, your content is amazing! Short, straight to the point and educational. Love your tutorials! :)

    • @Blackthornprod
      @Blackthornprod  6 лет назад +3

      Thanks Thomas ! Yep I see what you mean for the clipping. The reason it sounds that way is actually because I cut the video in certain parts so there aren't too many pauses (and so the video is shorter). But I'll definitely be improving the way I cut up the audio so it sounds less choppy :) cheers !

  • @razzledazzle6539
    @razzledazzle6539 5 лет назад +80

    I was so annoyed that none of the cursors were diagonal

  • @vaqakamadview
    @vaqakamadview 6 лет назад +7

    Great video, but i have a cursor hotspot issue, it does not allign with the tip of my sprite cursor, how can I change it.

    • @Blackthornprod
      @Blackthornprod  6 лет назад +6

      That's probably due to the placement of your sprite cursor's pivot point (in other words the little blue circle) ! Just tweak that a little in the sprite editor and things should work well :) ! Hope this helps !

    • @vaqakamadview
      @vaqakamadview 6 лет назад +5

      Yep, that did it, thanx!

    • @theemeraldfalcon9184
      @theemeraldfalcon9184 5 лет назад +1

      @@vaqakamadview I tried this but it doesn't work. my sprite still doesn't line up properly

  • @firesnail1477
    @firesnail1477 5 лет назад

    Oh no! I tried the whole "cursor changes sprite when the mouse is clicked", but whenever I click the mouse, the sprite just disappears. Please help!

  • @Ethan-ss8lb
    @Ethan-ss8lb 5 лет назад

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class mouseCursor : MonoBehaviour
    {
    private SpriteRenderer rend;
    public Sprite handCursor;
    public Sprite normalCursor;
    void Start()
    {
    Cursor.visible = false;
    rend = GetComponent();
    }
    void Update()
    {
    Vector2 cursorPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    transform.position = cursorPos;
    if(Input.GetMouseButtonDown(0))
    {
    rend.sprite = handCursor;
    } else if(Input.GetMouseButtonUp(0))
    {
    rend.sprite = normalCursor;
    }
    }
    }

  • @darth3437
    @darth3437 6 лет назад +72

    For the Ori and the blind forest effect, you can actually just use 1 particle system and change "Simulation Space" from local to world space and it should work as intended without the performance hit of instantiating new particle systems! Hope this helps anyone who wants to do that!

  • @DistractedCoder
    @DistractedCoder 6 лет назад +21

    Hopefully people will see this. It would be better to use a looping particle system for the trail. That way you game is not constantly spawning the trail and it would free up a bit of processing.

  • @adamknight4563
    @adamknight4563 5 лет назад +22

    I have a minor problem with this: my mouse is now underneath my Canvas UI... how do I put it in front of my other UI on the Canvas?

    • @Toopa88
      @Toopa88 4 года назад

      Set the sorting layer to UI and increase the Order in Layer if needed.

    • @k0shmarNevaBroke
      @k0shmarNevaBroke 4 года назад +1

      @@Toopa88 have the same issue, that didnt do anything

    • @TopBagon
      @TopBagon 4 года назад +1

      @@k0shmarNevaBroke just increase the order in layer option of the sprite that you're using as a mouse

    • @noellekkar903
      @noellekkar903 4 года назад

      Go in 3d and change the z axis , maybe....

    • @fastpicker89
      @fastpicker89 4 года назад +1

      Same issue, and I'm finding this is a much larger issue. Can't seem to find any simple solution to this anywhere in the forums or Anwers.

  • @NotElayn
    @NotElayn 5 лет назад +7

    Using This Script My Cursor Is In fact moving. The Only Problem Is That It Is In The Bottom Left of The Screen. It does coorespond to the movement of the mouse, but it doesn't move far as it only goes around a little bit, not leaving the far left bottom corner. Please help

    • @nythrokgames4442
      @nythrokgames4442 3 года назад +6

      Dayem bro, I hope I'm not late, I had the same problem, BUT I FOUND THE RESOLUTION! Basically the thing Camera.main.ScreenToWorldPoint() is an idiotism, delete it, so it will look like this: Vector2 cursorPos = Input.mousePosition;
      At least it's working like this for me, I hope it will work for you too!

    • @KaganParlatan
      @KaganParlatan 3 года назад

      @@nythrokgames4442 You great!

    • @tizizzails6817
      @tizizzails6817 3 года назад

      @@nythrokgames4442 I had the same issue, you fixed it!

  • @davidmeinname
    @davidmeinname 3 года назад +2

    How to render the cursor it in front of the UI?

  • @alexcosmos9895
    @alexcosmos9895 Год назад +1

    Отлично. Теперь запиши видео - как это будет выглядеть на фоне Overlay Canvas :)

  • @mirela9974
    @mirela9974 6 лет назад +5

    Hi Blackthornprod! I have a big question. Could I use this method in a 3d game? Because it doesn't work for me. Please help

  • @jovanveselinovic5966
    @jovanveselinovic5966 4 года назад +4

    i have camera following player with cinemachine and i make cursor with this script but when player move cursor is shaking how to fix that

    • @citricmelon
      @citricmelon 4 года назад +2

      parent your cursor to the camera

  • @sentinelmusic107
    @sentinelmusic107 4 года назад +2

    I get the error message "NullReferenceException: Object reference not set to an instance of an object" with the line Vector2 cursorPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); I don't know why I'm getting this error.

    • @megasaIexandros
      @megasaIexandros 3 года назад

      did you fix it? cuz im getting the same error

    • @sentinelmusic107
      @sentinelmusic107 3 года назад +1

      @@megasaIexandros It's been a while since I watched this video, I'm not even sure what part gave me this error.

    • @xThuby
      @xThuby Год назад

      This is pretty old now. But it seems like your camera is not tagged as MainCamera.

  • @_g_r_m_
    @_g_r_m_ 3 года назад +1

    Not working for me, i had to make a few changes in order to make it work, her's my script if someone needs it:
    public class MouseCursor : MonoBehaviour
    {
    void OnGUI()
    {
    Cursor.visible = false;
    }
    void Update()
    {
    transform.position = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
    }
    }

  • @YuriNoirProductions
    @YuriNoirProductions 6 лет назад +4

    Small tip on the cursor trqail...just create a script that follows the mouseposition in worldspace. now create a particle system that spawn particles over distance! now your have particle system that spawns particles relative to the amount of your movement

  • @dio8440
    @dio8440 5 лет назад +7

    Cursor rendering under the UI/GUI elements fix -----> Change your *Canvas* Render Mode to (Screen Space - Camera)
    Hope this helps.

  • @matssommervold
    @matssommervold 5 лет назад +2

    Nice vid, but my cursor appears under all the UI elements that are on the canvas. I tried making the cursor a rectTransform and put it under the canvas, but I can't figure out how to convert the coordinates from world point to whatever the canvas is using.

  • @blazer5724
    @blazer5724 4 года назад +3

    If you're following this tutorial I would highly recommend putting Cursor.visible = false; into Update method since people can alt-tab from your game and then the cursor will be visible.

    • @kitsuneandcake
      @kitsuneandcake 2 года назад

      Yeah, that's definitely a good idea!

  • @tristancowen5636
    @tristancowen5636 6 лет назад +4

    Hi Blackthornprod!!! I LOVE YOUR VIDS :) :) :). Ever since i started wathcing them, i felt you were really the guy who could teach me coding. Keep up the good work.

  • @Programisius644
    @Programisius644 6 лет назад +5

    But using a sprite for cursor will cause a problem, the cursor will not be visible when mouse is over an UI sprite.

    • @Blackthornprod
      @Blackthornprod  6 лет назад +4

      True enough ! You'll have to make your cursor a UI image instead ! Should of definitely shown how to do so in the video, and certainly will in a future tutorial ! Thanks for pointing that out :)

    • @Programisius644
      @Programisius644 6 лет назад +5

      Solved it by making a UI image and and adding a Rect Transform, script is almost same as the one in the video except Rect Transform instead of Transform.
      Here the final product of cursor :D
      prnt.sc/kbbmv7
      Keep up the good work, loving your videos.

    • @khanakarnsakaew4244
      @khanakarnsakaew4244 6 лет назад +1

      Hey can you show me how to do that exactly please? I've tried but still couldn't figure it out. Thanks :)

    • @emc1905
      @emc1905 5 лет назад

      I also need help figuring this out :)

    • @DexDrakon
      @DexDrakon 5 лет назад

      I'm still having the same problem. I'm trying use rectTransform.transform.position but no use

  • @direpixel4947
    @direpixel4947 4 года назад +3

    For those of you looking to put this on top of everything, create a Canvas set to Screen Space - Overlay and make sure the sort order is higher than your other Overlay canvas'. Then create an Image on that canvas that will store your Cursor. Anchor it to the top left with a pivot point of (0, 1) and set the position to 0,0. Lastly, uncheck Raycast Target on the image. Add the cursor script to set mouse position and it will line up exactly.

    • @GokdenizCetin
      @GokdenizCetin 4 года назад

      Thanks but there is double cursor when I alt-tabbed the game

    • @JeloOW
      @JeloOW 3 года назад +2

      @@GokdenizCetin 1 month late so you probably figured it out but it can be helpful for new people
      put Cursor.visible = false; in the Update method

  • @supersaiyan9616
    @supersaiyan9616 6 лет назад +7

    Please make tutorials on art in 3d

    • @Blackthornprod
      @Blackthornprod  6 лет назад +2

      3D art/modeling will definitely be covered on the channel in the future :) ! Stay Tuned !

  • @MrFarkasOfficial
    @MrFarkasOfficial 3 года назад +3

    This guy never fails to teach me something new

  • @nightwolffba
    @nightwolffba 5 лет назад +2

    Thanks man, I was trying to update the cursor directly but your solution is much more versatile.
    I went one step further and added the sprites onto a canvas and used that as my cursor.
    Thanks again and good luck with the videos, sales for whispers and your next projects!

  • @1206Vince
    @1206Vince 6 лет назад +3

    Hey Noa, my cursor is behind the GUI, how do I put the cursor above the UI? the canvas is in Screen Space - Overlay

    • @dio8440
      @dio8440 5 лет назад

      Just change the sprite layer and done.

    • @BlackAngel81
      @BlackAngel81 5 лет назад

      hello vince did you find fixed the cursor to be in front of the GUI? and how you fixed it ? thanks

  • @MarellaSbrenz
    @MarellaSbrenz 5 лет назад +1

    Doesn't work for me =\ and I don't know why. My sprite just lays on the canvas.

  • @AlexanderZotov
    @AlexanderZotov 6 лет назад +4

    Great one!

  • @carsonh7222
    @carsonh7222 2 года назад +1

    I've done this script exactly as shown, but whenever I start the game, the cursor does not show at all. I used the method where the cursor is a sprite overlay instead of the actual cursor. The position is following the mouse, and the image is visible when the script is disabled, the cursor graphic just disappears when following the cursor. Does anyone have a fix?

    • @captainorigami7518
      @captainorigami7518 2 года назад

      Im having this issue too, did you find a solution?

    • @carsonh7222
      @carsonh7222 2 года назад

      @@captainorigami7518 Yes I did actually, I just deleted my script and made a new one, then deleted the game object and made a new one for that, too. I think I just messed up something in settings (since I checked tons of boxes while trying to find a solution). It will work, though!

    • @captainorigami7518
      @captainorigami7518 2 года назад +1

      @@carsonh7222I found out my issue as well, my camera and layers were all stacked in the wrong order and my mouse was behind my background the whole time!

    • @taayakin1108
      @taayakin1108 2 года назад

      @@captainorigami7518 THANK YOU!!! oh man what a rookie mistake, but i've been trying to figure out what i was doin' for like 15 mins and it was sorting layers...i might've spent way more time w/o your comment !!!

    • @captainorigami7518
      @captainorigami7518 2 года назад +1

      @@taayakin1108 no problemo, anytime my fren

  • @tapendrashahi2097
    @tapendrashahi2097 6 лет назад +2

    Hey, noa. Thank you so much for the hard work you put up on making these tutorials.I am really learning so much. It would be awesome if you taught about the touch phases and such kinds of stuff to use in mobile game development. Like moving a character or player with swipe of finger. I am getting stuck while making a game cause i dont get how the touch functions work in unity. And also many peoples here would also probably want that kind of tutorials.

  • @JHLandAML
    @JHLandAML 5 лет назад +1

    for method 2 set the image to not a raycast target or unity thinks you click on the mouse. (this took me a while to work)

  • @dbweb.creative
    @dbweb.creative 2 месяца назад

    how do you deal with lag between hardware cursor and sprite on canvas? the lag looks bad when mouse is moved and cursor feels sluggish.

  • @drakomatic
    @drakomatic 5 лет назад +1

    for pixel art i reccomend 15 x 15 and changing the sprite settings to bilinear to no filter(pixel perfect)

  • @lottomatto
    @lottomatto 5 лет назад +2

    What can I do to prevent the cursor from being under buttons?

    • @Frost-ml4vj
      @Frost-ml4vj 5 лет назад

      Instead of making the Cursor a gameObject, make it a UI image, and change 'transform' to 'rect transform' in the script. Should work

    • @GokdenizCetin
      @GokdenizCetin 4 года назад

      +1

  • @llamapunk89
    @llamapunk89 3 года назад +1

    I've been scouring the internet for a few days now, trying to figure out how to change the actual cursor itself dynamically, but couldn't find anything close to what I was trying to do. The whole "get a sprite to follow your cursor and hide your cursor" is simple, elegant, and exactly what I've been looking for!

  • @imdrogon
    @imdrogon 2 года назад

    Thanks, helped for my game called civilization sandbox (sry if spelt wrong, I'm suomi.) and I want a universe sandbox like cursor.

  • @chinyonglim7624
    @chinyonglim7624 6 лет назад +1

    Hmm~
    upload 9 min ago~
    video length 9min14sec~
    people are giving like at 5min ago~XD
    Btw great video again~

  • @duanefgrabner7068
    @duanefgrabner7068 5 лет назад +1

    Nice tutorial! There is no need to create a destroyer script for effects since the particle effect has a method built in to destroy itself. There is a stop action option toward the bottom of the first panel of particle effect settings from which you can choose destroy.

  • @AzizTheGazele552
    @AzizTheGazele552 5 лет назад +1

    Help, "visible" which you put after "Cursor." doesn't exist for me. I don't know how to make my white cursor disapear because of that :/

    • @AzizTheGazele552
      @AzizTheGazele552 5 лет назад

      Nevermind, I went on
      docs.unity3d.com/ScriptReference/Cursor-visible.html
      and copy and pasted their code. I don't rlly know what was the problem, but im glad i found a solution!

  • @RaasiqShaikh98
    @RaasiqShaikh98 2 года назад

    Hey so does this not work in unity 2021?
    I'm new to coding and would love some help with that

  • @armandopenatamayo691
    @armandopenatamayo691 Год назад

    Awesome video like alway ...but don't mess with Don't Starve 😬😅

  • @_za740
    @_za740 4 года назад +1

    how would one go about doing this with the new unity input system :)

  • @yassgaming22
    @yassgaming22 4 года назад +1

    How to make the cursor bigger like in your screen shake tutorial?

  • @lottomatto
    @lottomatto 5 лет назад +1

    I like this video, but I have a problem. When I start the game in editor, the Console shows: NullReferenceException : Object reference not set to an instance of an object. I hope you can help me.

    • @sasookay514
      @sasookay514 5 лет назад +1

      set the camera tag to "MainCamera'

    • @lottomatto
      @lottomatto 5 лет назад +1

      @@sasookay514 . I did it . When I start the Game in Editor, the game starts without problems. But now the Sprite don't follow the Mouse Position!

    • @71Arlekino
      @71Arlekino 5 лет назад

      @@lottomatto I have same problem((

    • @lottomatto
      @lottomatto 5 лет назад +2

      Oh ! Maybe I have the answer. Set the Camera from Perspective to Ortographik.
      Hope it helps.

  • @BloxzillaYT
    @BloxzillaYT 2 года назад

    1 minute for explaining what means ¨cursor¨ LOL

  • @xaiga29
    @xaiga29 4 года назад +1

    The information is incomplete, the cursor is underneath all elements and that renders it unusable.

    • @TheWestonini
      @TheWestonini 4 года назад

      Change the "Order in Layer" on the cursor object's Sprite Renderer component to something high so that it always displays on top of everything else.

    • @xaiga29
      @xaiga29 4 года назад +1

      @@TheWestonini I did that and it didn't work. I found a better way to do it anyway.
      public class CustomCursor : MonoBehaviour
      {
      [SerializeField]
      Texture2D crosshair;
      void Start()
      {
      Cursor.SetCursor(crosshair, new Vector2(256, 256), CursorMode.Auto);
      }
      }
      My cursor icon is 512*512 px, and the hotspot is half of that, or Vector2(256, 256), so the center of the pointer is the center of my cursor image.
      Just make sure you cursor icon/image is set to cursor instead of UI in the inspector.

  • @JoshuaReyes
    @JoshuaReyes 6 лет назад +1

    You are awesome, I have wanted to do this forever! Keep up the great work! The quick format is so helpful.

  • @atitjeu
    @atitjeu 6 лет назад +1

    i'm programmer but i like to see your teach of 2part(unity,art) thx a lot

    • @Blackthornprod
      @Blackthornprod  6 лет назад

      More art/unity tutorials are coming up :) !

  • @PhilDeveloper
    @PhilDeveloper 3 года назад

    dont name your cursor script = "Cursor" or you will get an error when trying to access the actual cursor

  • @bunggo9914
    @bunggo9914 6 лет назад +2

    wow, it looks cool!

  • @fastpicker89
    @fastpicker89 4 года назад

    I get this error:
    Assets\Scripts\Cursor.cs(9,16): error CS0117: 'Cursor' does not contain a definition for 'visible'

    • @lorenzocerato6081
      @lorenzocerato6081 3 года назад

      Make sure that your .cs file isn't named "Cursor", this will affect the execution of the code! All you have to do is just rename the file and the text after "public class" (in the 5th line if I'm not mistaken)

  • @JasonMorelandDigitalrecline
    @JasonMorelandDigitalrecline 3 года назад

    Anyone know what the games were other than ori? I like to look of the game at. 39 secs

  • @SamaX1010
    @SamaX1010 5 лет назад +1

    Can you cake cursors that are animated / do animations when a button is clicked

    • @Skyvastern
      @Skyvastern 5 лет назад +1

      Yes for that, you need to have a reference to the Animator component of the Cursor's gameObject in the script which contains the function which will be called when the button is clicked.
      Then just set the condition, whatever you have chosen be it a trigger or bool.

    • @SamaX1010
      @SamaX1010 5 лет назад +2

      @@Skyvasternalright thanks for letting me know

  • @GreenPetl
    @GreenPetl 2 года назад

    I swear cursor are cursed for me lol. Windows, Unity none of them want to change my cursor, no matter what i do. *Sigh* Although despite my failure your video is awsome! Clear instruction and upbeat tone make a huge difference! immagonna smash my finger on that 'LIKE' button and slowly meander 'The Cursed One* over to caress the subscribe. There immediatley hunching down and retreating into the dark void that is the WEB.

  • @GaviTSRA
    @GaviTSRA 4 года назад

    Brackeys said you should NEVER use camara.main cause it does something like this(sry if something is wrong) : .... FindObjectWithTag("MainCamara")......

  • @alexeybolotov3797
    @alexeybolotov3797 2 года назад

    For particles - it's better to use Emission - Rate over Distance, and you can use only one particle system, assign it as a child to Cursor and not spawn new particle system each time you need it.
    But if you still need to spawn Particle Systems - it's better to use ParticleSystem.Stop() action instead of Destroy, and in Particle System -> Main settings -> Stop Action select Destroy. In this way it will stop generation particles, and after all particles will be done - it will destroy whole game object.

  • @AngelCnderDreamer
    @AngelCnderDreamer 5 лет назад +1

    This was amazing! Thank you for this! I been waiting for this for ever about the cursor. This was very well explained, and easy to understand.
    c: P.s I subscribed!

  • @hristiyanaleksandrov198
    @hristiyanaleksandrov198 Год назад

    For me it just hides the cursor lol

  • @konyameram1
    @konyameram1 2 года назад

    Fun fact, I was siiting in an exercise session and my volume was maxed out (didn't realize it until it was too late). People got scared ^^

  • @jezamae-amorpagaduan7112
    @jezamae-amorpagaduan7112 6 лет назад

    This didn't work for me... Can you help?
    I get an error saying "Type 'UnityEngine.Camera' does not contain a definition for 'ScreentoWorldPoint' and no extension method 'ScreentoWoldPoint' of type 'UnityEngine.Camera' could be found. Are you missing an assembly reference? (CS1061)"
    Not sure what to do, and I can't seem to find any solutions.
    Here's my code:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class mouseCursor : MonoBehaviour {
    void Start(){
    Cursor.visible = false;
    }
    void Update () {
    Vector2 cursorPos = Camera.main.ScreentoWorldPoint(Input.mousePosition);'
    transform.position = cursorPos;
    }
    }

  • @iamzen_1077
    @iamzen_1077 5 лет назад

    Having the same problem with the UI Canvas making it so the cursor won't appear. Tried to make the cursor a UI Image as a child of the canvas but still didn't work... :/

  • @babitadeboer6338
    @babitadeboer6338 3 года назад

    Amazing! I couldn't get my custom cursor to show. Some weird raggedy lines appeared instead and that's because I did not change Texture Type to "Cursor". This saved me hours of searching like a blind chicken. Thanks, man!

  • @zakwanmasud2406
    @zakwanmasud2406 5 лет назад

    Facing problem.the problem is that the sprite cursor doesn't get above the UI(canvas)..please help

  • @niko587
    @niko587 2 года назад

    with a thicc black
    outline

  • @manolov4074
    @manolov4074 3 года назад

    Doesn't work in 3d ...

  • @animationsbelike
    @animationsbelike Год назад

    thank you so much :D

  • @wolfkaiser5228
    @wolfkaiser5228 3 года назад

    Cursor.visible does not work now ):
    Edit: it works

  • @bibekgamebox1083
    @bibekgamebox1083 4 года назад

    Great Video Noa...You're also funny with your voice

  • @Delvarn
    @Delvarn 4 года назад

    How do I create a variable to manage cursor speed in game?

  • @zemangofur3986
    @zemangofur3986 4 года назад

    my texture is glitched out what can i do about that?

  • @shuraproger7448
    @shuraproger7448 4 года назад

    Like with 3 akk

  • @imaginomania2
    @imaginomania2 5 лет назад

    Hi Blackthorn,
    I have some issues with the code while i click. I use the right and middle button.
    I don't seem to be able and find the reason why that happens.
    As you can see i added an if statement cause i was taking an error that was asking me to check if my SpriteRenderer is attached or not. And as it seems as soon as i press any of the mouse buttons the SpriteRenderer becomes null.
    If you guys can see where i made a mistake or have an idea why it happens please let me know.
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class MouseController : MonoBehaviour
    {
    Vector3 lastFramePosition;
    private SpriteRenderer rend;
    public Sprite clubArrowDown;
    public Sprite clubArrow;
    public GameObject clickEffect;
    // Start is called before the first frame update
    void Start()
    {
    //Set the clasic windows cursor invisible
    Cursor.visible = false;
    rend = GetComponent();
    }
    // Update is called once per frame
    void Update()
    {
    Vector3 currFramePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    //Change the appearence of mouse cursor
    Vector2 cursorPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    transform.position = cursorPos;
    if (rend != null)
    {
    // It reverts to the original cursor instead of changing the sprite of my cursor
    if (Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2))
    {
    rend.sprite = clubArrowDown;
    // Setting up particle system for my cursor
    Instasiate(clickEffect, transform.position, Quaternion.identity);
    }
    else if (Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2))
    {
    rend.sprite = clubArrow;
    }
    }
    else
    {
    Debug.Log("The SpriteRenderer can not be found");
    }
    //Handle move/drag cammera
    if(Input.GetMouseButton(1) || Input.GetMouseButton(2))//Right and middle mouse button
    {
    Vector3 diff = lastFramePosition - currFramePosition;
    Camera.main.transform.Translate(diff);
    }
    lastFramePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    }
    }
    Thanks in advance for looking into my script.

    • @nailotsot
      @nailotsot 3 года назад

      @Sushid00 well, at least you tried

  • @Kisuji_
    @Kisuji_ 3 года назад

    your videos are the best for my game project!

  • @zaart1334
    @zaart1334 6 лет назад

    Nice video, Thx
    btw, can you tutorial about How to Build Unity Project to Android (apk) and set up the android sdk?
    Thx for your awesome video

  • @IamNeighborlee
    @IamNeighborlee 4 года назад

    Doesn't work, I changed to a cursor I got from unity store, and placed it where yours is, but in game I still get these weird multicolored lines , that make up a weirdly transparent ISh tiny square. What might be going on ?

    • @sentinelmusic107
      @sentinelmusic107 4 года назад

      In the Inspector, set the texture's Texture Type to "Cursor" instead of "Sprite(2D and UI)".

  • @sup-dp4bh
    @sup-dp4bh 3 года назад

    0:55
    hell nao

  • @supersaiyan9616
    @supersaiyan9616 6 лет назад

    Thanks 😇 you so much for your great response . But please make the steps you followed to improve your art work in 2d and 3d.

  • @spicyvegetable3705
    @spicyvegetable3705 5 лет назад

    I hate you cuz i love you so im addicted to your videos

  • @evanrechsteiner518
    @evanrechsteiner518 5 лет назад

    Hey Noah! How would one go about disabling the mouse completely while still maintaining button functionality from the Input built into Unity?

  • @godot-boy7694
    @godot-boy7694 4 года назад

    I was looking for such video, Thank You

  • @tapendrashahi2097
    @tapendrashahi2097 6 лет назад

    Hey, noa. Thank you so much for the hard work you put up on making these tutorials.I am really learning so much. It would be awesome if you taught about the touch phases and such kinds of stuff to use in mobile game development. Like moving a character or player with swipe of finger. I am getting stuck while making a game cause i dont get how the touch functions work in unity. And also many peoples here would also probably want that kind of tutorials.

  • @SpreekA
    @SpreekA 5 лет назад

    aaawh man, you could have wrote customice instead of that for the jokes 1 year ago.

  • @abdoudjam6846
    @abdoudjam6846 6 лет назад

    Great ! you are covering a lot of stuff that really indie gamedevs should know ! THANKs a lot brother ;) !

  • @MaliciousTachyons
    @MaliciousTachyons 5 лет назад

    Dude...I dunno how often you hear this, but I LOVE your tutorial videos. thank you!

  • @eriknastesjo843
    @eriknastesjo843 4 года назад

    Would be cool to know how to do this in perspective mode!

  • @sasookay514
    @sasookay514 5 лет назад

    Am I the only one where things are not working wonderfully?
    I'm at @3:49 just trying to get the sprite to follow my mouse in a 3D environment, but when I play the scene, it only captures the first set of coordinates and then it doesn't change? The Image is stuck hovering in mid air. Anyone?

    • @matssommervold
      @matssommervold 5 лет назад

      Did you make sure that you are updating the position in Update() ?

    • @hungrygrimalkin5610
      @hungrygrimalkin5610 3 года назад

      You need to change shit entirely son.
      First change the image back to cursor then make an empty game object and attach your script, no need for sprite renderers.
      Here is the script
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class Cursorscript : MonoBehaviour
      {
      [SerializeField] Texture2D cursorName;
      // Start is called before the first frame update
      void Start()
      {
      Cursor.SetCursor(cursorName, Vector2.zero, CursorMode.Auto);
      }
      // Update is called once per frame
      void Update()
      {
      }
      }
      save and attach your cursor picture to the script slot you made for Texture2D.
      No need for thanks GTFO!

  • @PJURALszymon
    @PJURALszymon 2 года назад

  • @mfatihbilhaq4977
    @mfatihbilhaq4977 6 лет назад +1

    Thx

  • @Kaikaku
    @Kaikaku 6 лет назад

    I'm new to your channel. This is a nicely packed and very usefull episode. Thanks :)

    • @Blackthornprod
      @Blackthornprod  6 лет назад

      Welcome to the family :) ! And thanks for the feedback !

  • @TechLevelGames
    @TechLevelGames 2 года назад

    Cool tutorial! Thanks!

  • @brauliojorgealmeida
    @brauliojorgealmeida 3 года назад

    Thanks! It helped me :)

  • @bobbywinston1880
    @bobbywinston1880 6 лет назад

    Hey which is better for animations in unity animate or photoshop

    • @Blackthornprod
      @Blackthornprod  6 лет назад

      Hey Bobby :) ! Well Adobe Ps is awesome for traditional frame by frame animation, I'm afraid I've never had a go with Animate CC so I can't tell you much on that point. You could also try Spine which is great for 2D bone based animation (Unity's simple animation features is also great)

  • @UndeadEarth1
    @UndeadEarth1 4 года назад

    Thank you for the well thought out tutorial and info.

  • @giuseppegiarratana478
    @giuseppegiarratana478 4 года назад

    Thank you! This is the video I was looking for

  • @rj-nj3uk
    @rj-nj3uk 6 лет назад

    why don't you do a video on level design?

  • @VeiusIuvenis
    @VeiusIuvenis 5 лет назад

    Could this sprite cursor work on UI? I created a cursor following these steps, but it failed when I moved the cursor onto the UI element. So sad.

    • @iamThePaleowarist
      @iamThePaleowarist 3 года назад

      turn off the "Raycast target" thing in the image

    • @sonistata8390
      @sonistata8390 3 года назад

      @@iamThePaleowarist Thank you I was trying to fix this issue.

  • @hexercodes540
    @hexercodes540 6 лет назад

    Awesome video bro! Like your character! :D

  • @adriking5383
    @adriking5383 4 года назад

    my pixelart cursor is blurry how do i fix this?

    • @zacharywalker-liang7319
      @zacharywalker-liang7319 4 года назад

      when importing pixel art sprite , make sure you set your sprite to the correct pixels per unit , filter mode: point no filter, compression: None

  • @simoncodrington
    @simoncodrington 6 лет назад

    When in doubt, add more 3D particle effects! 🎆🎇
    Cheers for the video man :)

  • @rms4448
    @rms4448 3 года назад

    Thanks for the tut bro 💪