How to make a Tooltip: Always Visible (Unity Tutorial for Beginners)

preview_player
Показать описание
👍 Learn to make awesome games step-by-step from start to finish.
Let's take our Tooltip and make sure it never leaves the screen and is always on top.

If you have any questions post them in the comments and I'll do my best to answer them.

See you next time!

#unity3d #tutorial #unity2d

--------------------------------------------------------------------

Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.

I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.

--------------------------------------------------------------------

Рекомендации по теме
Комментарии
Автор

🌐 Have you found the videos Helpful and Valuable?

CodeMonkeyUnity
Автор

You're really cool, I want to start developing games, so your channel helps me very much, thank you!

uwbsfxe
Автор

Thanks for being so inspiring! Personally I like tooltips to flip to the other direction if getting out of screen. To achieve this, replace the code in the Update function with the following snippet:

Vector2 localPoint = Input.mousePosition;

if(Screen.width - Input.mousePosition.x < {

localPoint -= new Vector2(backgroundRectTransform.rect.width, 0);
}

if(Screen.height - Input.mousePosition.y < {

localPoint -= new Vector2(0,
}

transform.position = localPoint;


Note that I use Screen Space - Overlay mode, so the RectTransformUtility stuff is irrelevant.

skelhain
Автор

Thanks for these man. Coding through the Unity UI system is so much hell :D.

spadelight
Автор

Any idea why the tooltip would flicker licke crazy when dealing with those out-of-screen-edge cases?
EDIT: nevermind, I found out: I used TextMeshPro instead of the standard thex, I didn't know that it had a hidden Raycast Target setting (it's under "Extra Setting"). When the tooltip slid under the cursor, the text interfered with the detection of the mouse on the object.

captainufo
Автор

@Code Monkey  Yes a few.

Visual bugs - The game Sprites when in 3x or 2x speed end up getting stuck on places like Walls and inside Buildings. Ps : They stay stuck even upon game restart

Heavy Bugs - When you have more Buildings (10 or more) the game gets Really laggy and unstable, with contant crash upon autosave or manual save.

People Get stuck when buy Water and food after 10 min playing, the only way to fix is to close Building remove worker and restart the game.

The Inside of Arenas "Bland" bug, you can have all itens of decorarion and a lot of then people Will be happy "arena looks cool", upon loading a save game, the same arena gets bad review "arena looks bland

danielkjm
Автор

Pls a guide on how to make different maps for each lvl like urs.

ahjed
Автор

Is there a reason you're calling transform.GetComponent<...> instead of just GetComponent<...>?

flameprincess
Автор

third. 🤗
Hey. . .is it possible to do a tutorial on how to make a destiny style tooltip for weapons/items please. . .please, please? 😥😥😥

zaam
Автор

I've followed every step carefully and no matter what I try to do, the tooltip keeps flickering on and off.

in.vasive