Designing A Responsive Tooltip System in Unity

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

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

  • @DamageSoftware
    @DamageSoftware Год назад +15

    Great guide!
    I modified a little the logic that sets the pivot of the tooltip in order to position it relative to the mouse cursor depending of the screen quadrant.
    private void Update()
    {
    var position = Input.mousePosition;
    var normalizedPosition = new Vector2(position.x / Screen.width, position.y / Screen.height);
    var pivot = CalculatePivot(normalizedPosition);
    _rectTransform.pivot = pivot;
    transform.position = position;
    }
    private Vector2 CalculatePivot(Vector2 normalizedPosition)
    {
    var pivotTopLeft = new Vector2(-0.05f, 1.05f);
    var pivotTopRight = new Vector2(1.05f, 1.05f);
    var pivotBottomLeft = new Vector2(-0.05f, -0.05f);
    var pivotBottomRight = new Vector2(1.05f, -0.05f);
    if (normalizedPosition.x < 0.5f && normalizedPosition.y >= 0.5f)
    {
    return pivotTopLeft;
    }
    else if (normalizedPosition.x > 0.5f && normalizedPosition.y >= 0.5f)
    {
    return pivotTopRight;
    }
    else if (normalizedPosition.x

    • @shaytan992
      @shaytan992 2 месяца назад

      Thanks for this, tooltip positioning is much better than the original code alone!

  • @smally5739
    @smally5739 4 года назад +57

    The UI god, understanding the rectransform class and other ui components has been one of my biggest challanges with unity tbh, and there's very little resource on this, thanks for the tutorials!

  • @JasonSmith-jv7wl
    @JasonSmith-jv7wl 4 года назад +26

    I gotta say, toggling on and off a layout element to handle sizes smaller than your max size is just genius. So many projects at work I have written complicated code to do the same thing, but this is just so much easier.
    I didn’t actually care about the tooltip system when watching this, (I’ve coded up similar systems a lot) but it is gems like the layout element trick that made me want to check this out. Great problem solving there.

  • @travlake
    @travlake 4 года назад +44

    If I'm not mistaken the 3:54 layoutElement.enabled trick requires manually matching your chosen characterWrapLimit to your chosed preferredWidth in the Layout Element. An easy way to avoid this is using "layoutElement.enabled = Math.Max(headerfield.preferredWidth, contentField.preferredWidth) >= layoutElement.preferredWidth;
    " instead

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

      Goated comment for saving me some time thinking about something slightly annoying, but not annoying enough to deal with later

  • @AllDayBikes
    @AllDayBikes 4 года назад +43

    me: "huh thats a thumbnail I don't remember --oh new game dev guide video, finally!"
    I've binged the others too many times in the last 2 months haha

  • @reggieisnotadog4841
    @reggieisnotadog4841 2 года назад +14

    Great tutorial! I learnt a lot. If anyone is looking to get this a bit more 'mouse snaps to corners of cursor to stay on screen' rather than have be based on screen position average, the below might be helpful to you in place of the rectTransform positioning bit of the tutorial:
    Vector2 position = Input.mousePosition;
    float pivotX = position.x / Screen.width;
    float pivotY = position.y / Screen.height;
    float finalPivotX = 0f;
    float finalPivotY = 0f;
    if (pivotX < 0.5) //If mouse on left of screen move tooltip to right of cursor and vice vera
    {
    finalPivotX = -0.1f;
    }
    else
    {
    finalPivotX = 1.01f;
    }
    if (pivotY < 0.5) //If mouse on lower half of screen move tooltip above cursor and vice versa
    {
    finalPivotY = 0;
    }
    else
    {
    finalPivotY = 1;
    }
    tooltip.rectTransform.pivot = new Vector2(finalPivotX, finalPivotY);
    tooltip.transform.position = position;
    ----------------------------------------------------------------------------------
    SMOOTH TWEENING IN UPDATE:
    If you want the above to move smoothly rather than completely snap you can call a DoTween sequence to position it in the Tooltip's update (just be sure if you do this, to kill the tween sequence if already running and then again on hide or you'll get wonky behaviour). Sorry, I don't know LeanTween but I'm sure you can do the same with it.
    So in the update of the tooltip itself I replace the "tooltip.rectTransform.pivot = new Vector2(finalPivotX, finalPivotY)" bit with:
    finalPivot = new Vector2 (finalPivotX, finalPivotY);
    if (rectTransform.pivot != finalPivot)
    {
    moveSequence.Kill();
    moveSequence = DOTween.Sequence()
    .Join(DOTween.To(() => rectTransform.pivot, x => rectTransform.pivot = x, new Vector2(finalPivotX, finalPivotY), .5f))
    .Join(DOTween.To(() => rectTransform.pivot, y => rectTransform.pivot = y, new Vector2(finalPivotX, finalPivotY), 1f))
    .SetRelative(false)
    .Play();
    }
    moveSequence is a DoTween Sequence variable I declared at the top of my code
    Hope that helps someone!

    • @chengkuangyu
      @chengkuangyu 2 года назад +2

      Thanks for the solution, great topping on the original version.

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

      Exactly what I was looking for, thank you!

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

      thanks i was thinking the exact same thing and this code worked perfect for it

  • @Devsplorer
    @Devsplorer 4 года назад +42

    I couldn't track how those 9 minutes passed, the explanation was so smooth! Great video, thanks for sharing 😊

  • @Pedro_Marangon
    @Pedro_Marangon 4 года назад +36

    3:54 another way of doing line 24 is to just set the layoutElement.enabled to the condition to be true (since if the conditions are true, then it sets to true and the opposite happens too), like:
    layoutElement.enabled = (headerLength > characterWrapLimit || contentLength > characterWrapLimit);

    • @FriMeDev
      @FriMeDev 4 года назад +8

      That actually bothered me too.

    • @binaryparrot3352
      @binaryparrot3352 4 года назад +9

      I paused the video there to find this comment. It annoyed me too much.

    • @travlake
      @travlake 4 года назад +13

      Or layoutElement.enabled = Math.Max(headerfield.preferredWidth, contentField.preferredWidth) >= layoutElement.preferredWidth;
      This has the advantage of obviating the "characterWrapLimit" parameter, which is annoying to calibrate. Instead it just uses the LayoutElement's preferred width you set.

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

      Agreed. no need of using ternary operator here

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

      @@zoltan9498 need, becouse if component disabled all responce from him is null.

  • @abo1428
    @abo1428 4 года назад +21

    „It‘s LEANTWEEN time“ 😂
    Great video as always! Hope to see a new video soon

  • @rasmusskovbo7572
    @rasmusskovbo7572 2 года назад +2

    Great guide!
    Something you didnt touch on that i used myself:
    If you want to add the tooltip to objects at runtime (e.g. for inventory items instantiated from a base of Scriptable Objects), you can use AddComponent and set the title, content, etc afterwards with info from the SO.

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

    2:54 tooltip image not adjusting height in my case if disabling header or content object. Any idea why this happening? I watched videos 10+ times, i can't find anything that I missed. 🙏🙏🙏

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

      You need a source image and the image type Sliced in the tooltip.

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

    Came here for ToolTips... stayed for all the layout element tricks.
    Finding this video made my week!

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

    The wait is always worth it. Thank you very much for all these GREAT Game Dev Guide tutorials!

  • @vitiet8229
    @vitiet8229 3 года назад +5

    At 3:57, line 24, it's better to use
    layoutElement.enabled = headerField.preferredWidth > layoutElement.preferredWidth || contentField.preferredWidth > layoutElement.preferredWidth;
    As you're comparing the preferred size of TMP to the Layout Element preferred size rather than arbitrary text length which does not work for when you use special TMP features such as HTML color or Sprite asset.
    Hope this helps.

  • @olpacheco
    @olpacheco 3 месяца назад

    One of the best tutorials I ever seem!
    Thank you, man!

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

    I developed a custom tooltip system long ago but I was unaware of how to manage its pivot according to the screen width. Your video save me thanks matt.

  • @150zero150
    @150zero150 3 года назад +3

    4:33 If your copying the code over, be sure to keep the "static" on the Show(), I was getting a CS0120 error for a bit.

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

    This is a huge puzzle piece for the project I'm working on, with such a clear and concise explanation. Thank you so much!

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

    Hey, I doubt you'll see this but I just wanted to say this is by far my favourite game dev channel on RUclips. You make everything so clear and easy to understand, and cover so many bases and edge-cases that others usually wouldn't. Thank you so much for this, you've helped me a ton.

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

      Thank you so much for the kind words! I'm glad you find the videos useful. ❤️

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

    I'm often blown away by how beautifully made you videos are. Excellent instruction. Thank you!

  • @wildKawa
    @wildKawa 4 года назад +17

    Thanks for the tutorial. This might be personal preference but the visual cuts are a biiiit fast for me. Stopped counting how often i had to stop the video just to see what was happening. I like that it doesn't waste a lot of time but especially the drag and drop stuff is hella fast.

    • @Malaron2
      @Malaron2 9 месяцев назад

      I had to slow it down to half speed. Makes it more entertaining also since it sounds like a drunk person is explaining programming to you. (due to slow speech) :P

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

    Hello,
    How to use LeanTween.delayedCall when game is paused (Time.timeScale = 0f)? Because tooltip is not appearing when the game is paused.

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

    I Had developed something similar to this before, but your solution is way more elegant and cleaner.
    Great Job!

  • @EllieHatesCake
    @EllieHatesCake Год назад +13

    Sure this will be useful to someone... it sets the pivot of the tool-tip so it is positioned next to the mouse. This keeps it on the outside of the tool-tip at all times, so you can clearly read the text. Similar to how it is displayed at the end of the video.
    Vector2 position = Input.mousePosition;
    float x = position.x / Screen.width;
    float y = position.y / Screen.height;
    if (x = 1 - y) //right
    Rect.pivot = new Vector2(1.1f, y);
    else if (x = 1 - y) //top
    Rect.pivot = new Vector2(x, 1.3f);
    transform.position = position;

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

      Thank you for your comment. I can confirm it works

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

      Thank you a lot !

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

      Thanks!

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

      this looks great, thank you!

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

    I developed a system with tooltips for a card game that's currently in steam when I worked in it but with all of this I think I'd make a better one using this knowledge, really awesome!

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

    Fantastic tutorial, super well spoken, edited and the code + explanations are great man! Will be implementing this tonight!

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

    Thank you! This came at JUST the right time - I've been putting off implementing tooltips to my game, and this is a MUCH better way than the one I've been using so far. I love it! Thank you! Please keep doing these.

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

    your UI videos are always fantastic. doubly so because it can be a bit hard to find actually useful UI info sometimes!

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

    This has been incredible! Thank you so much for making it! :D I love how you explain extra things such as doing it for gameobjects or how to get information for what text to display, it's greatly appreciated :)

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

    I went through alot of diffrent tutorial and all the features that this one had and boy is this easier Very underaterd

  • @legitchrisv
    @legitchrisv Год назад +2

    For those whose Tooltip image/text shows on Start, keep the Tooltip canvas active before playing, but turn off the Tooltip GameObject. When you hover over the items, the tooltip will show and hide when you exit. This will stop the Tooltip from showing when you start playing and are not hovering over anything.

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

    You, my friend, are some kind of sorcerer! Absolutely banging video. great content. Thank you so much! SUBBED.

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

    This is exactly what I needed, and your video arrived just in time. Thanks man!

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

    Dynamic pivot was awesome solution, thanks for the truck!

  • @huseyin.goktas
    @huseyin.goktas 4 года назад

    Thank you. Simple, elegant, and useful. Making clear UI is very important for a successful game.

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

    Great video, I really appreciate your concise editing!

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

    This was awesome. I hate UI/UX, so hard to do right, but you make it look simple!

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

    I was having trouble getting the tooltips to show on non-UI objects, eventually discovered this was due to me using unities new input system. The solution was to add a physics raycaster component to the camera. Now pointer events (such as OnPointerEnter/OnPointerExit) can be called on non-UI objects without needing OnMouseOver() and OnMouseExit() in the tooltip trigger script.

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

      Thank you for sharing your solution to this!

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

    Hi, instead of using a ternary operator, you can simplify it like this:
    layout.enabled = headerLength > characterWrapLimit || contentLength > characterWrapLimit;

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

    Awesome, awesome, awesome!! Your tutorials are next level, thanks, buddy!

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

    Definitely gonna use it someday! I'm currently building a game for mobile, so it may be unnecessary. Tho I still learned something. I didn't know that you can use content size fitter to adjust the recttransform automatically. Definitely a helpful thing.
    Keep up the great work man.

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

    [Multiline()] is how he got the bigger text area in the editor, just above public string content; in TooltipTrigger script. You can see it at 8:05 in the video.
    When I got to transform.position = position; in the Tooltip script, my tooltip disappeared. What happened was that I was using a camera to put the overlay to fit game screen, so the tooltip was appearing miles away for some reason.
    Once I put the Tooltip Canvas -> Canvas component -> Render Mode back to SCreen Space - Overlay, it was fine. I had to reset the transform value on the tooltip too to put it back where it should be.
    There's probably a proper way to make it work with a screen space overlay set to camera, but it worked with that little fix anyway.

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

    Really nice video, will definitely be one I keep referring back to whenever I want tooltips :D

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

    its LeanTween time - one more useful video! Thanks

  • @ludwintor4986
    @ludwintor4986 4 года назад +9

    Hello! Can you make a tutorial in which objects in a layout group move smoothly, and not just jump after removing or adding an element?

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

    This man is a hero we don't deserve

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

    1:50 there is any tutorial to make a camera movement like that with the mouse?

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

    Your Channel is doing the Lords work. ty

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

    as a general programming tip, if you are going to do anything life (statement) ? true : false, the statement itself returns true or false
    so the code: layoutElement.enabled = (headerLength > characterWrapLimit || contentLength > characterWrapLimit) ? true : false;
    can be: layoutElement.enabled = (headerLength > characterWrapLimit || contentLength > characterWrapLimit);

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

    Great as always Matt

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

    I'm trying to figure out how did you do the offset from the mouse after changing the pivot thorugh code, cuz between 7:49 and 8:45 the tooltip firts shows right in the middle and under the mouse while afterwards it has a slight offset from the mouse that it's waaay better.

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

      The rest of the video was really interesting (thought I did skip the LeanTween cuz I haven't used it yet and.. when I did import it to the proyect, it broke a lot of it so... maybe in another one)

  • @xAjido
    @xAjido 2 года назад +2

    Couple issues/thoughts. When my tooltip first enables and shows up on the screen, something looks off about it. Almost like it's enabling first then repositioning which I can notice. The other minor thing is the content/header strings in the TooltipTrigger script should have the [TextArea] header for easier entering and formating of information.

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

    5:53 was just wondering, why does your inspector show a textfield for the content? do you use some special inspector or is there a tag for it? thx

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

    If someone else is using the new input system and trying to OnPointerEnter on a sprite, you have to add a Physics 2D Raycaster to your camera and a collider to the sprite

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

    there are some missing info's in the video, after the pivots / screen, which moves whenever the cursor get close to screen edges, and then at the end of video suddenly the tooltip still in the next cursor ? idk how?

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

    Still a wonderful guide. Thanks a lot!

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

    Amazing work! Thank you for sharing!

  • @mrcreepypl
    @mrcreepypl 4 года назад +23

    Honestly though, how the f*** do you not have a milion subscribers already!? I really don't get it, your videos are much higher quality than Brackeys (in my opinion).

    • @genericmeme
      @genericmeme 4 года назад +6

      Are you sure you're not just biased because Brackeys mostly targets(/targeted...) total beginners and this channel doesn't?

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

    Thank you! So crisp and useful!

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

    Great video👍, love the ui series.

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

    Celebrate your success of your tutorial! ;)
    If you could do a tutorial about the country lines, like 0:36 , that would be great.

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

    Wow, what a great tutorial. Really well done and thanks a lot :)))

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

    Great video - as always!

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

    Thank you very much for sharing all these amazing contents.

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

    I'm actually using this in my current prototype, thank you

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

    Lovely video, enjoyed this.
    Thanks..
    one note i found.;
    new inputsystem takes 2 lines..
    get the inputsystem and read the value ;) ohh and the value is a vector3 not 2.
    Using UnityEngine.InputSystems;
    get the value as such.
    Vector3 position = Mouse.current.position.ReadValue();

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

    That ternary operator at 3:53 hurts my soul, ngl

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

    what a nice tutorial, ty for the great content :D

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

    Very helpful!! Thank you mate!

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

    I've followed this and have no errors in my code however the tooltips wont appear? Or if I enable the canvas in the inspector the tool tip is permanently showing. I get errors object reference not set to instance of object, making reference to current.tooltip.gameObject.SetActive(false); in the Tooltipsystem script

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

    Never saw that kind of like/dislike ratio, well deserved :)

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

    Thanks for the video, it helped a lot!

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

    How is he able to get a margin on the left and right of his text with the Content Size Fitter? I keep trying to rearrange my canvas image but the text is still really close to the edges.
    EDIT: He added a padding of "10" to each element in the Vertical Layout Group, just saw that.

  • @Merivio
    @Merivio 5 месяцев назад

    Also using static means Unity can't serialize it, so if you modify code and have Unity hotswap it while the game is running, you'll lose the tooltip reference. A fix for this is to put current = this inside Update() as well.

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

    Amazing video. Love it!

  • @vasil-yt
    @vasil-yt 4 года назад +1

    Love the UI videos

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

    Really excellent videos!

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

    This is amazing. Thank you!

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

    Lmao, the LeanTween time cracked me up. Btw nice tutorial

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

    This is a good tut. I could use this.

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

    Awesome video !
    I actually ended up making something very similar for Ludum Dare 50 this week-end. 🤣

  • @Light-wz6tq
    @Light-wz6tq 4 года назад +2

    1k likes, 0 dislikes, *visible great content*

  • @treymtz
    @treymtz 11 месяцев назад

    IMPORTANT: IF YOU HAVE IT LINGER PAST THE OBJECT NOT BEING HOVERED OVER:
    In the Tooltip_Trigger script, if the object gets disabled or destroyed before OnPointerExit gets called, it will stay on your screen until you hover over another tooltip trigger.
    TO FIX THIS: Simply make an OnDisable() or/and OnDestroy() method in the Tooltip_Trigger to Hide() the Tooltip as well.

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

    I'm using Unity 2021.3.2f1 and so much of the UI components have bugs in them now. I can't get the IPointerEnterHandler (or the Exit handler) to work.

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

    Is it possible to use buttons over the text. I'm currently working on something in Unity and want the player to be able to interact with objects in the game world. So for example when they hover their mouse over something instead of getting the canvas image with the text, is there a way to present them with 2 or 3 button choices? Great Video.

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

    At 8:45, my tooltip UI keeps on the center of the mouse, how to make like yours that can change on the top right of the cursor?

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

      did you found a fix? i have the same problem

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

      @@michele6064 yes, I found my fix after practicing for 3 days. I need to calculate mouse position of x & y devided screen width & height. Then it got value from 0f to 1f, I need to eliminate decimal so the value rounded to int 0 to 10f. Then using enum to make a change between 4 screens(left, top, right, bottom).

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

      @@restushlogic5794 can you share the line of code that i had to add? what i have to add after it
      Vector2 position = Input.mousePosition;
      float pivotX = position.x / Screen.width;
      float pivotY = position.y / Screen.height;

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

      @@michele6064 Yes, of course, I'm happy to share my code. I hope after I share this code, I can totally finish my game and stop myself from procrastinating.
      void Update()
      {
      rectTransform.pivot = CalculateRect();
      transform.position = GetPosTouch();
      }
      public enum ScreenSide
      {
      TopLeftCorner,
      BottomLeftCorner,
      BottomRightCorner,
      TopRightCorner
      }
      public ScreenSide screenSide; public Vector2 CalculateRect()
      {
      float pivotX = GetPosTouch().x / Screen.width;
      float pivotY = GetPosTouch().y / Screen.height;
      float X = Mathf.Round(pivotX * 10f); // old 0 to 1.0 => 0 to 10
      float Y = Mathf.Round(pivotY * 10f); // old 0 to 1.0 => 0 to 10
      readPos.SetText($"X = {X} || {GetPosTouch().x} || {pivotX } " +
      $"Y = {Y} || {GetPosTouch().y} || {pivotY}"); // readPost var is another Textmesh pro for debugging
      if (X < 8 && Y > 5) screenSide = ScreenSide.TopLeftCorner;
      else if ((X > 7 && Y > 5)) screenSide = ScreenSide.TopRightCorner;
      else if ((X > 7 && Y < 7)) screenSide = ScreenSide.BottomRightCorner;
      else if ((X < 9 && Y

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

      @@restushlogic5794 This was so helpful! Thanks for this submission on here its much appreciated.

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

    Yuh' Know, I was skeptical of LeanTween because I hate using packages that I didn't make. But Between this, and the fade with Leantween.alphaCanvas. It was super easy to do compared to writing my own coroutines or learning invoke etc... Thanks again

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

    you deserve more likes.

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

    Great video. Commenting for the algorithm

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

    How did you do the fade animation? I've been trying to get it to work with LeanTween, no success yet.

    • @GameDevGuide
      @GameDevGuide  4 года назад +7

      Put a canvas group on the component and use Leantween.alphaCanvas

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

      @@GameDevGuide Thank you

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

      @@martynawasiluk1405 can you help me please? what i have to do?

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

    Is it possible to change an image in the tooltip depending on which object the mouse is currently over. Please resbond if you can help 👍

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

    Hey, would oyu consider doing a similar tutorial for UI Toolkit?

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

    excellent tutorial, thank you

  • @joymagine
    @joymagine 9 месяцев назад

    nice easy concise thanks alot great stuff thanks

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

    Where to put the code of InputSystemUIInputModule at 6.30? need proper explaination for that please

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

    This is really useful for displaying basic strings but what about referencing variables in the tooltip? At the start of the video you hover over some objects what have more advanced tooltip information...

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

      These videos only serve as a base for people to build on! For your suggested use case, you can use string formatting on the tooltip and pass the info into the formatted string / tooltip from some other component when it's required.

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

    3:52 you don't need a ternary if you're returning true and false.

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

    Thank you very much for your tutorial!
    How could one do the same as in CK3? If the player hover over the TooltipTrigger for some time, it "print" (instanciate) the tooltip to allow "hypertext" link to other tooltip ?

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

    This is awesome!

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

    I'm so glad I found your videos! Question though... I mainly deal with Mobile games. Is there a solution you'd recommend for Mobile? Would love to see a video on Mobile solutions for common problems like these