Forum rules - please read before posting.

CycleHotspots

Hi !
I'm trying to find out where in AC's code the cyclehotspots is.
I need to see how it works because i want to create interactions that will cycle through hotspots using buttons (for the switch port) while still keeping the mouseover detection method (everything works perfectly).

Can you tell me where i can find the relevant pieces of code ? I've checked the hotspot.cs but don't think it's in there (unless i missed it)...

Thanks !

Comments

  • The ability to cycle through Hotspots comes from the DetectHotspots scripts, which is attached to the Player if you make use Player Vicinity Hotspot detection.

    I'm not sure what you're referring to if you're not using that component, but you can control exactly which Hotspot is selected by using "Custom Script" Hotspot detection and setting the active Hotspot manually:

    AC.KickStarter.playerInteraction.SetActiveHotspot (myHotspot);
    
  • Hello again.
    What i'm trying to figure out is a way to cycle through hotspots without changing the hotspot detection method in AC's settings.
    The game works fine as is, i just want to add a way to cycle through with buttons.
    Right now, i have no idea how the cycle thing works or how the plugin detects hotspots/handles them.

    Thanks.

  • But what is your current detection method? The default is Mouse Over, which doesn't allow for cycling, because it's based on the cursor position.

    Please share your Settings Manager in full so that I can see how your game is currently played.

    If you want to allow for cycling between Hotspots, you need to switch to Player Vicinity detection and use the CycleHotspots / CycleHotspotLeft / CycleHotspotRight inputs.

    See the Manual's "Player-vicinity detection" chapter for details on this topic.

    If you want to dive into the code-base, the PlayerInteraction script is where Hotspot detection and selection occurs. Its CheckForHotspots function returns the Hotspot that should be selected - you can modify this if you want to add in your own functionality, but I recommend instead using a separate script to set the active Hotspot as I described above.

  • It's mouse over and i don't want to change it, as i said it works perfectly (even the touch screen ^^).
    I just need to create some code that teleports the cursor to the nearest hotspots when the user uses a button. (because the user still retains the usual stick movement for the cursor, similar to a mouse pointer).
    I've already made some heavy changes to the code so that everything works on switch...so i don't mind going into it.

    Thanks for the scripts indications, that's what i was looking for (had checked hotspot.cs and detectHotspots.cs).
    With this i should be able to handle it the way i need.
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.