Hello, i need to disable all hotspots in a scene while subtitles are going, because i don't want to lock player during subtitles due to a strange effect it gives when stopped while moving (its a UFPS v2 Player), and because i'm using 16:9 letterbox to show on hotspot name and subtitles, any idea? Actually if i still move while subtitles are on i can see through subtitles the name of the hotspot. I know via disable AC can manage this but subtitles will stop to work as well. Any help Thank you
PS
Wrong category, sorry
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You can use the Engine: Manage systems Action to disable the Interaction system, which will prevent Hotspots from being interactive.
If you just want to stop Hotspot names from showing up, you can use the Menu: Change state Action to lock the Hotspot menu.
Thank you, it helped
A further question regarding disabling and enabling hotspots. In a PNC adventure game, I have a big room with tens of hotspots. I'd like to be able to disable all of them but one and later enable them back on. Through Engine>Manage systems, disabling the Interaction system would disable all hotspots.
Is there a way to do this without adding tens of "disable hotspot" and then "enable hotspot" actions?
You can do this through scripting. The following script will turn off all Hotspots in the scene, except the one assigned in its component Inspector:
To use it, paste in a C# file name TurnOffHotspots and add to an empty in the scene. Assign the Hotspot to ignore in its Inspector, and then pass the TurnOn/TurnOff commands to it using the Object: Send message Action.
Thanks once again @ChrisIceBox, the script works great. However, there are two things I didn't take into account:
And the second, more complex issue:
Good points.
This one allows for multiple Hotspots to be assigned:
For the ignoring of Hotspots that are already off: that could be added as well, but you may have issues when it comes to game-saving if you save or load the game after calling TurnOff and before calling TurnOn again.
In this case, you can either teleport your Hotspots off-screen when you want to disable them completely, or use an alternative script that makes Hotspots non-interactive by assigning an unused camera into each Hotspot's "Limit to Camera" field - though this'll only work if you aren't currently using that feature:
Thank you so much @ChrisIceBox, this works wonders! And a good point regarding potential issues with game-saving. I think the simple teleporting of such hotspots offscreen might be the way to go for me, unless there's a good reason why the latter script should be the preferred solution...
Both are valid, it's more down to which workflow you want to use.
Hi, I tried the first script as I feel it might become handy for what I'm trying to do, but Unity is throwing this error:
TurnOffHotspots.cs' must derive from AC's Action class in order to be available as an Action.
It looks like you're placing this in an Actions folder - either AC's own or a custom pointed to by the Actions Manager.
The TurnOffHotspots script isn't an Action - place it in a regular script folder and it should work.
I understand now! By the way, is there any package of actions available for AC? It would be great to have a comprehensive package containing the most useful actions that people, or even yourself Chris, have contributed over the years and have them all in one place. It's just an idea that I thought would be helpful.
That's really the intent behind the AC wiki - though it mainly contains scripts, it can also contain links to .unitypackage files.