I am trying to make it possible for the player to be able to hover the mouse over hotspots while the game is in Cutscene state and reveal the label of each hotspot, but I am having trouble implementing that without altering the source code of AC.
I have tried changing the 'Hotspot detection method' to 'Custom script' and implemented custom logic that finds the active hotspot via 2d raycast (I am developing a 2D game) and calls SetActiveHotspot(), but it seems that this is not enough as the PlayerInteraction logic, clears the hotspotLabelData while in cutscene mode (~ line 2355) and the PlayerMenus logic does not turn on the menu in cutscene mode (~ line 1385). If I comment out those two, I can somehow achieve what I want but it's possible that I have introduced a regression somewhere else.
Is it possible to follow a different route in order to implement this?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Yes, I'd recommend a different approach as this way will most likely have unwanted effects elsewhere.
If you have a custom raycast that can get the hovered-over Hotspot, you can bypass PlayerInteraction and just show the Hotspot's name in a Menu manually.
To keep things totally separate, you could create a separate "Hotspot Cutscene" Menu that's styled the same as your regular Hotspot menu, but instead has an Appear type of Manual, and the Label's Label type set to Global Variable.
Link this to a Global String variable, and your custom script would then just need to set this variable's value to the name of the Hotspot, and turn the Menu on:
Thank you Chris, I will try that and report back.
Do you recommend leaving the 'Hotspot detection method' to 'Custom script' so that my custom raycast logic works both for Normal and Cutscene game states or revert it back to 'Mouse Over' and have the custom raycast logic work only when Cutscene state is active?
The latter should be fine, so long as the custom raycast logic returns the same result as AC does.