Forum rules - please read before posting.

Player Vicinity and Camera Issues

Hi there,
I encountered a couple of problems I could not solve with the help of the tutorials/forum/manual.

I use direct control (mouse and keyboard) for character movement, player vicinity (show all) for hotspot detection.
I want the Hotspot's label to appear at a fix position above the hotspot when the player gets close to it. When he sees the label, he can click the hotspot to interact (this second part works).
Right now, I still need to have the cursor above the hotspot to see the label, and the label moves with the cursor in range of the hotspot. This behavior is useless to me, because I want the vicinity to detect the hotspot and the mouse to use it. Right now I still need the mouse for the player to see the hotspot.
Using "nearest only" for hotspot detection is even worse, because with this option I can click anywhere on the screen to use the hotspot (which I do not want) and the label follows the cursor everywhere.

I tried to use center point (override) to fix the label position, but this does not have any effect at all. What does it do?

2. For some selected hotspots, I want to disable the player vicinity requirement or maybe trick is somehow. I want the label to appear above the hotspot and make the hotspot clickable, even if the player is not close to it. I thought about using a trigger + Hotspot - change interaction action list to fake it, but whatever I try, nothing happens in the end. (maybe because of the vicinity blocking it?)

3. I have a custom camera script that enables a oblique frustum for the camera, so I can move the area the camera captures without changing the camera's point of view. Thing is, the script only works when it is attached to the main camera. When I attach it to my differenct AC cameras, nothing happens. Why is that? I want different obliqueness values for my different AC cameras, but I dont know how to do it (without coding) when I can use the script only once.
(I really hope that was understandeable.)

4. @ChrisIceBox
Do you think you can add side scrolling camera behavior for Y-Axis as well? The side scrolling feature is great to keep track of the player without having a wobbly camera every time he moves - why cant I use it for up/down movement of the player?

Thanks in advance! I am afraid there is more to come ...


  • 1) The default Hotspot menu has a Position type field of Follow Cursor.  If you instead set it to On Hotspot, then it will be positioned over the Hotspot it is enabled for.  By default this will be in the centre of the Hotspot's collider, but you can tweak the position exactly by defining the Centre-point (override) Transform.

    As you've found, the Hotspot menu is also limited to showing one-at-a-time, and will display when the mouse hovers over any given Hotspot.  However, through scripting, it can be made to show when a Hotspot becomes highlighted - which will occur for all nearby Hotspots when Hotspots in vicinity is set to Show All.

    Such a script can be found in the AC wiki:

    2) Is this to be at the same time as other Hotspots are used in the normal way?  If so, I'll have to look into making some adjustments to allow for this - though it'll likely still need a simple script to force the Hotspot on.  Otherwise, if this is a separate moment in the game, you can change the Hotspot detection method at runtime with another simple script.  Any Manager field can be changed at runtime - right-clicking on a field's label will give you an API reference to it.  In this case, it's:


    3) See the "Cameras overview" chapter of the Manual: AC GameCameras are used for reference only, and don't do any rendering themselves.  Any image effects must be placed on the MainCamera, as you've found.  However, if you also place this component on your GameCameras, then you can rely on the OnSwitchCamera custom event to transfer these values onto the MainCamera when a new camera is switched to.  An example can be found in the Manual's "Camera effects" chapter.  If you'd like more assistance with this, you'll have to provide more information about the custom camera script.

    4) I'll look into it.
  • Ah, I missed position type On Hotspot. Thanks!

    I hoped the rest would be easier, because the behavior to show the label on
    player vicinity is already there (Nearest Only) and the need to click
    the hotspot is already there as well (Show All). I hoped to get away
    with copying two lines of code from one script to another or maybe find a hidden checkbox "Display label when hotspot is highlighted". ;)

    Unfortunately, the the stuff you described is too complicated for me. I think I will have to learn scripting at some point and come back to these issues in the future ...
    That is easier and less annoying than asking you every time I need a single line of code.

    Until then, I will stick to "Nearest Only". With your helpful advice regarding the position type field, it is close enough to what I wanted in the first place.

    Thank you very much!
  • edited February 2018
    The wiki script posted above is a workaround for the fact that such an option is not available.  It doesn't need to go into any existing AC script - you can just paste it into a fresh C# script file and begin using it, no need to know how it works.
  • edited February 2018
    Oh, ok. I did that already. But there was a part in the wiki which I did not understand:

    "Back in each Highlight component, check Call custom events? and create new events for both the On Highlight On and On Highlight Off events.  On Highlight On should invoke its associated MultiHotspotLabel's ShowForHotspot method (setting the Hotspot parameter as appropriate), and On Highlight Off should invoke its Hide method."

    To me that sounds like there is further scripting required to create the custom events which will make the wiki script work?
  • edited February 2018
    The opposite, actually - the script has functions that need to be run, but the event system is a way of running them via a UI:

    Once you check Call custom events? in the Highlight Inspector, you'll be able to click the + icon as described under "Using UnityEvents" and reference the ShowForHotspot method as described in the wiki.  You want it to look something like this:

  • It works! Thank you so much.
    First I forgot to add the Hotspot to "object to highlight", but now it is fine.

    Any simple way to create these components/settings automatically for each new hotspot?

  • A custom Editor script could go through it all automatically, but otherwise it'll have to be done manually.
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.