Hello,
I believe I have encountered a bug related to the Hotspot Detection method. When I modify the method through a custom script action, alternating between 'mouse' and 'vicinity', the hotspot ceases to be detected.
Here is the custom action script
`public override float Run ()
{
AC.KickStarter.settingsManager.hotspotDetection = HotspotDetection.MouseOver;
if (!isRunning)
{
isRunning = true;
return defaultPauseTime;
}
else
{
isRunning = false;
return 0f;
}
}`
I only edited this part, everything else is the same.
I have unity 2023
and Latest AC update
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
As the Action only needs to run once, you can simplify it to:
Which method are you having trouble with, and do you have issues if you set that method as the default within the Settings Manager, before changing it at runtime?
I set it like this and I got this error:
"ActionChangeHotspotDetectionToMouse.cs(34,25): error CS0161: 'ActionChangeHotspotDetectionToMouse.Run()': not all code paths return a value"
and I fixed it with:
-Both methods have this issue when switching from mouse to vicinity or from vicinity to mouse.
-No issue with the default method. It just stops working when changing the detection method via this action script.
Quite right.
Thanks for the details - I'll attempt a recreation. Does the issue also occur if - instead of running the Action - you manually change the "Hotspot detection method" field at runtime in the Settings Manager?
Yes, even when changing it manually through the settings manager the issue is still there.
When set to "Player Vicinity", uncheck Place distant Hotspots on separate layer?.
Thanks Chris. It works fine now even with the custom script.