Hi
As the title says, I would like to have hotspots (some, at least) that are visible to the player as per the usual rules (raycast settings, which are for visibility, not interaction as I understand it) but which can only be interacted with if they are "within reach" of the player.
I haven't been able to find any settings or forum threads for this particular situation, so I just wanted to check if there's some mechanic for it already that I am overlooking, before spending time making my own.
It's for a 2D sidescrolling game.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Raycast settings are for Hotspot detection and interaction.
If you want Hotspots to be interactive if within a certain area of the Player, you can set your Settings Manager's "Hotspot detection method" to "Player Vicinity", and define a Hotspot Detector on your Player to act as the area that they must be within.
See the Manual's "Player-vicinity detection" chapter for details on this.
Alternatively, you can assign an "Interactive boundary" to a Hotspot", which the Player must be within in order to interact with that Hotspot.
Sounds like it's the last option that is interesting for me, as I want the hotspots to be always detectable but only interactable within an area around the player.
Will look into the boundary solution - thanks for the guidance!
A Hotspot's interactivity and detectability are synced. If you're looking to separate them, you'd have to make it always be interactive, and modify the way the Interaction behaves at the point of the player clicking.
One way to do this would be to unassign the Interaction ActionList from the Hotspot's Inspector, and instead have a custom script that hooks into the OnHotspotInteract custom event to trigger it only if the Player is within a set distance: