0
\$\begingroup\$

I'd like to make a Tooltip System/Tutorial System.

I'm using the Content Size Fitter and Horizontal Layout Group components to have a dynamic text bubble..

Also I'd like to attach a button to it,

  • so when the tooltip appears, the game pauses,

  • and then when the player clicks the button, it closes the tutorial text, resuming the flow of the game.

But for some reason the click doesn't reach the component. Not even the animation happen, like something is blocking my button from being clicked.

Hierarchy:

enter image description here

uiTutorialText

  • Has a CanvasGroup to fade the whole structure.

    • Interactable = true, BlocksRaycast = false

TutorialText

  • Has an Image (background)

    • RaycastTarget = false
  • Has a Content Size Fitter and a Horizontal Layout Group enter image description here

And Text and Button are just simple plain Text and Button objects, and the Button's Interactable is true.

I also tried making the Button a child of Text, and then translating it sideways, so the button doesn't share screen space with the tooltip. But it's not clickable this way as well.

As soon as I move the Button out of the hierarchy, like directly under the canvas, it works.

\$\endgroup\$
2
\$\begingroup\$

Has a CanvasGroup to fade the whole structure. Interactable = true, BlocksRaycast = false

Try checking "blocks raycast". CanvasGroup applies to the parent and all of its children. Unchecking "blocks raycast" is telling Unity "this object and all of its children should ignore the mouse".

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.