Tooltips not showing up where they're supposed to

So, for some bizarre reason the tooltips aren’t spawning where they are supposed to. They don’t show up next to the quest list, but rather in the center of the screen. After taking a closer look, it would seem the tooltips are spawning under the base UI canvas, and not as a child of the quest. I’m using the tooltip spawner that we got in the inventory course, so I doubled checked and it indeed has the parent’s transform set as a parameter in the instantiate. I am very confused as to why it’s not spawning the tooltip as the child of the quest when it is being given its transform.

That is odd…

Can you show your QuestItemUI Prefab with the QuestTooltipSpawner?

And here’s the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GameDevTV.Core.UI.Tooltips;

public class QuestTooltipSpawner : TooltipSpawner
{
    public override bool CanCreateTooltip()
    {
        return true;
    }

    public override void UpdateTooltip(GameObject tooltip)
    {
        throw new System.NotImplementedException();
    }
}

I haven’t touched the Tool Tip Spawner. I used the package given to us during that course and the patch that came along later.

I’ll have to have a look at the tooltip in the course repo… but I’m wondering if the offset in the Position X is part of the issue… (I’m at work, so I’ll have to look at it after I get home, or more likely after I take my wife out for anniversary dinner).

I tried messing with the position, and all that does is change where on the screen it is. If I have no choice, I can have a static tooltip over the quest log, but I’d rather have it next to the quest like it shows in the video.

I checked the course version, and it’s set up like yours.

This is the result in the course version:


This is my result.

Is the QuestTooltipSpawner attached to the QuestUI or the Quest?

It’s attached to the Quest.

I’m not sure what’s wrong at this point… everything would appear to be the same as in the course, from what we’ve looked at…

Zip up your project and upload it to https://gdev.tv/projectupload and I’ll take a closer look. Be sure to remove the Library folder to conserve space.

I have done so.

So I took a look at this, and it looks like you have the QuestTooltipSpawner, but most of the Quest system is not in yet.

After putting in some dummy questUI prefabs into the course repo, I got the same behaviour as you are getting, as the current QuestUI are just the prefabs and have not been configured…

I think once you’ve implemented the full Quest section of the course, that the tooltips will have the information it needs to hover in the correct locations.

Just finished the Tooltips Quest Objectives lecture and it’s now working. No idea why, but it is.

It’s because the TooltipUI wasn’t properly set up yet. It was causing the tooltip itself to stop early before setting a location.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.