Forum rules - please read before posting.

grouping hotspots

Hello everyone,

First post here, first of all congratulations to Chris, this looks like a really useful toolkit you have created, cheers!

I started using it yesterday, I'm quite new to this, so if what I'm asking has been answered already, please feel free to redirect me to the relevant post, as a quick search didn't turn up any results. On to the question now:

I'm trying to set up a quick system to turn Hotspots on and off. I've found the Action : "Hotspot: Enable/Disable", however that only works on one hotspot at a time. I figured I'll child all relevant hotspots under an empty GameObject, and change its state accordingly using the SetActive function (I've written a custom Action that takes care of this, works quite good, +1 to Adventure Creator for custom Actions!)

I have a bit of an issue however with the hotspots when I try to group them (put them as children in an empty GameObject). It seems that when I child any hotspot to anything other than the "_Hotspots" object, it stops working (even if the new parent is itself a child in "_Hotspots"). Can't click it at all, it is as if it's not there. If a hotspot is over a navMesh for example, when it's clicked the character will simply walk to that point on the navMesh, disregarding the hotspot completely.

To the double question then:
1. Why do hotspots break down when childed(?) to anything other than their default parent, and any ideas how to solve it?
2. Is there an alternate way to mass enable/disable hotspots? I'd rather not have to set up a new action for each hotspot individually, I'm looking at a dozen hotspots per area, ~10 areas per scene, a dozen scenes, you get the picture..

Thanks,
Kostas

Comments

  • edited June 2015

    I'm not quite sure if i understand your question correctley. You want to disable/enable multiple hotspots at the same time?

    Make one master hotspot as parent, put all other hotspot as children in it. Every child hotspot enables/disables the parent. The parent enabes/disables him himself.

    Make an interaction to disable/enable the parent. Call this interaction from every hotspot.

    Make sure the parent has 'Also effect children' checked.

    This works, i tried it out.

  • edited June 2015
    Thanks for the reply, Sprite, let me try and make it clearer:
    Yes, I want to enable/disable multiple hotspots at once. However, the enabling/disabling is not controlled by all of the hotspots themselves. Example: character is in room A, set up with hotspots for various examines/interactions, including a door leading to room B (presently invisible/disabled). The critical interaction we're discussing here is triggered by the "door hotspot". Once they open the door to the next room B, I turn on all assets (meshes, lights, and hotspots) for room B, and turn off everything in room A. 

    I managed to narrow down the problem a bit, and it has something to do with using mesh colliders for the hotspots instead of box colliders. Box colliders are a no-go for this project unfortunately, as the hotspots should only trigger from their front side. (To clarify, I tried Sprite's suggestion above, it works for box colliders, but not mesh colliders)

    What I'm doing at the moment is create a new hotspot from the AC scene manager, have it placed automatically over the selected object mesh, and then swap the hotspot's default box collider for a mesh (quad) collider. This works OK up until this point. If I now child this hotspot to anything, it stops registering, as if there's no collider attached to it. What's worse, I can't bring back functionality even if I undo the parenting, and I have to remake the hotspot from scratch.

    Can someone verify they get the same results? Create a new Quad, set up a Hotspot for it, swap the hotspot's Box Collider for a Mesh Collider, put a Quad Mesh as the Collider Mesh. Check functionality. Then put the Hotspot as child to another Object, and check functionality again, my results show the hotspot will not work.

    Thanks
  • Thanks for outlining the steps to reproduce, but actually they work for me.  I tried parenting it to both an empty, and a default Cube.

    A Hotspot should be detected if it's 1) on the Default layer, and 2) not "hidden" behind another collider that's also on the Default layer.  Its the layer value that the Hotspot: Enable or disable Action will affect, and the recommended way to set it's default setting is to add the RememberHotspot component to it, and set the Hotspot state on start value.

    I think you're going to have to post some screens of what you've got, because there's clearly something going wrong for you here if re-parening the Hotspot to the _Hotspots folder still breaks it.
  • Hey Chris, thanks for checking it out, it's weird that you didn't reproduce it, doesn't matter though. I managed to fix this, in not one, but TWO ways.

    The problem: Turns out, if a collider has a Z scale of zero, it doesn't work (who would have thought, eh? /facepalm for not catching this earlier). What happened was if I create a hotspot to be placed over a quad, the hotspot's box collider approximates the 2 dimensional quad by setting the Z scale to almost zero (6.123234e-17 in my case), which is still not zero, thus it works when it's first created. If I now parent it to ANYTHING, its Z scale gets rounded down to actual zero. Kinda makes sense, plus it explains why it won't work afterwards, no matter where it's re-parented. If I change its Z scale value manually, it's working again.

    The way I actually went at it though, came with the 1.46 package update: I used proper box colliders and made use of the "Limit To Camera" option, as in my case I'm working with multiple cameras.

    I'm guessing a minor tweak could be made in the hotspot creation part, to avoid having really thin colliders? Otherwise, just setting the z scale manually is also an option.

    Cheers
  • Yes, adding a tweak for that should be quite simple.  Thanks for the feedback, I'll look into that.
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.