Forum rules - please read before posting.

Different types of hotpot?

2»

Comments

  • Hi Chris,

    Thanks for that, got it now and implemented. Works fine, if a little buggy, (see below) but fine for my demo.

    I actually was imagining a slightly different (less hard-coded) solution.
    For example: If the items hotspot had an additional script, just a description. (Could b extended to include a few different types of information, weight, size, safety factors) that actually did nothing, but could be kept on a perfab made from the 3D object and the hotspot.
    Then the menu script you made, instead of looking for item IDs and displaying the correct description, would instead GET the description (and additional info) FROM the hotspot, and display it in the menu.
    Altho--- I guess it doesnt matter, its probably quicker to paste in all the different descriptions in one script, than to have to click on everything.
    It can be for example that my game randomly generates items, so I was thinking that having all the info contained on the item was better... but maybe not.

    But to the bug:

    I noticed that, for flawless operation, I must be careful to ROLL OFF an item before rolling over a new item.
    If I don't, the menu WILL jump to the correct place above the item, but the label will stay the same as the previous one.
    This must be the same for normal hotspot operation surely. suppose you have 2 hotspots one behind the other, you first look at the foreground item and as you mouse rolls off it, it immediately rolls over the background item... do you find this to be a bit buggy? Or is it just cos of the script, where everything is contained within one run function?
  • The Hotspot label is updated a different way - every frame, in fact.

    What you'll have to do, then, is something similar: instead of running this code within an Action, you'll have to run it in an Update() function on a new script that sits as a component anywhere in your scene (e.g. an empty GameObject).

    The code should transfer easily: just take the contents of your current Run() function - except the "return 0f;" and place it in a function named "Update" in a new script.  Then place that script on a scene object, and the label should update always.  You can then remove the Action from your "ActionList when turn on".
  • Thanks Chris!
    One final thing on this subject:

    Any way you can suggest for me to be able to use regular hotspots as normal? As you know this special type is for delivering item information, and Id like it to have a different "look" to a normal hotspot. After being shown around by a "virtual hostess" She lets you get on with your stuff (the game) but I want her to remain clickable for delivering hints, if you should need her.

    Mark
  • Sure - you could just extend the script to lock the menu if no special Hotspot has been found, egL

    Menu infoMenu = PlayerMenus.GetMenuWithName ("InfoMenu");
    if (foundID == 123)
    {
      infoMenu.isLocked = false;
    }
    else
    {
      infoMenu.isLocked = true;
    }
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.