Forum rules - please read before posting.

Player Vicinity Hotspot – Collider Blocking?

Hi,

I am using the Player Vicinity Hotspot system, set up as instructed in the manuals and tutorials, for a game using direct control - 3rd person - with the 3rd person camera. I am having the issue of Hotspots being clickable/activatable through Collider blocks, for walls, furniture, objects etc. I’ve read a selection of forums posts regarding the subject in previous years, but have yet to find a solution except for manual using triggers to activate/deactivate hotspots. Have I missed something in my AC settings or character setup?

Thanks

AC is 1.61.2 - Unity 5.6.1f1



Comments

  • How are you interacting with Hotspots once selected?  With the mouse cursor or via keyboard presses?

    The Hotspot Detector doesn't account for where Hotspots are in relation to anything else - if a Hotspot enters its trigger boundary, it'll be considered "close enough", regardless of the location of anything else.

    It's possible that a Raycast check could optionally be made to "block" Hotspots that have an unrelated Collider in the way, but it may still prove tricky to correctly arrange scene objects so that it's always effective.  If you can share some screenshots of a typical scenario, I'll consider what can be done.
  • edited March 2018
    Here is an illustrative image

    https://imgur.com/kSW0tuA

    The characters Hotspot Detection sphere detects the hotspot as interactive through visual walls or other objects etc, despite block objects Collision Cubes which stop the characters. If the hotspot sphere could not ‘see’ through Collision Cubes, the player would be unable to interact with the visually blocked hotspot.


  • Hotspots are interactive using keyboard, mouse click  and controller, via the method of activating the closet hotspot to the character, which is inside the Hotspot Detection sphere at the time. The icon is already displayed at that time and the associated object highlighted.

    The player could approach hotspots from almost any direction, so my only thought of a patch fix (based on old posts) is that a trigger region be placed around each and every hotspot to toggle activation. In a more open world situation (which the majority of the project is) falling back to using triggers to manually toggle the hotspots, even grouped ones for entering and leavings areas, via room doors or alike, would become a massive undertaking and will result in 100s of triggers.


  • I agree - manually disabling Hotspots like that would be unviable.  A custom script that manually disables Hotspots through raycasting would be much more practical.  I shall see if such a feature can be added officially, however.

    One issue to contend with so far as a raycasting solution goes, though, is that raycasting checks in Unity is prone to return false if the casting begins inside the collider - so if the centre of the Hotspot Detector is already within the Collision Cube, it may not be able to spot it.

    If that is the case, then a separate collider would have to be placed closer to the Hotspot - with the original used to block player movement only.

    That's just speculation on my part, however - I'll do some investigating.
  • Yeah, it's as I thought.  Raycasting between the Hotspot Detector and any potential Hotspot is unreliable, and takes too much effort IMO to get colliders set up to block it.

    I believe the better solution is to instead implement an optional "Interactable Boundary" object.  This would be similar to a Trigger in that it involves a Trigger Collider that only allows the Hotspot to be interactive if the player is within it's bounds.
  • I've always liked Final IK's "Interaction Triggers" approach to scene interactions, in which the interaction can only be activated within a certain distance and within a set angle. 

    https://www.youtube.com/watch?v=-TDZpNjt2mk

  • Are there any further instructions on using Interactive Boundaries whilst using the Player Vicinity Hotspot system, as I am still unable to get a result :( . Once Interactive Boundaries are created, the attached hotspot is always non-active. I have a player character with a rigid body and collider component. Could there be a layer issue? The Interactive Boundary is large enough for my character.


  • I'll need to attempt a recreation.  Let's see some screenshots of the layout of the scene itself, the Inspectors of the Hotspot / Interactive Boundary involved, and the Settings Manager.

    Please also let me know your AC/Unity version numbers, and also the result of temporarily relying on the Demo game's player, Tin Pot, by dragging him into the scene from /AdventureCreator/Demo/Resources.
  • Part Solved... After a little experimentation - Interactive Boundary’s are working, but only because as I have restored the player collider object to being a non child object of the main player and on a default layer. This means Interactive Boundary are now working  very nicely, but in doing so this has caused the return of and older tissue...

    That issue is that as the player collider is no longer a separate child object, it cannot be placed onto the Ignore Raycast layer, which results in the player themselves blocking hotspots cursors/icons from visually appearing. (This is despite using a HotspotDetector sphere itself a child object to the main player). The hotspots are interactive as they should be, but when the player character is standing between the camera (be it 3rd person ‘floating’ or other) and the hotspot, nobody knows they can click as there is no cursor/icon.

    So, I have put the entire character into the Ignore Raycast layer – will that cause any issues?




  • The player doesn't need to be on Ignore Raycast to be undetectable by raycasting - just not those listed under the Settings Manager.  For example, Hotspots are placed on "Default" - so only that layer is used when searching for them.
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.