In my scenes I have rooms with 1 or 2 Hotspots away from each other and I use the Player Vicinity but in another room I have hotspots (kind of keyboard buttons with hotspots) very near to each other and then I have to use the Mouse Over method.
Can I change these methods on the fly? using Action Lists ?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
AC.KickStarter.settingsManager.hotspotDetection = HotspotDetection.MouseOver;
I have done a custom action following your tutorial on how to do it but the use of AC.KickStarter..... I have not done nor seen a typical example. I followed the Forum on this subject (AC,Starter..) and there are plenty of discussions on how to do all kinds of changes but not a word on changing the Hotpot Detection method.
I am asking myself if there is a simpler way to do this I don't understand why people wouldn't have the problem that I mention when I have a number of keys/Hotspots very close to each other and then in the next room the Hotspots are 5-6 meters away and they show up already from this distance. In the former I would use Mouse Over and the latter Vicinity..
The method I have already given is very simple, and I have even given you the exact code you need to run. Please understand that there must always be a balance between providing many options through the Settings Manager, Actions, etc - versus empowering the user to do virtually anything with the scripting guide and custom Actions.
Yes!, I found out how to use your AC.KickStart and now just by use the Action List which I called ChangeHotspotMethod it works perfectly .
I only have a question:
I wanted to use a bool to choose true for Mouse and False for Vicinity but I had to use instead an Int:
mouseOver = EditorGUILayout.IntField ("1=Mouse, 0 = Vicinity",mouseOver );
because I could's find a way to use " BoolField" instead of IntField , it seems EditorGUILayout doesn't have any Bool, is this possible?
But Thanks again
Strange thing happened. I created the custom Action List that I call 'ChangeHotspotSetting' following your clues mentioned in the above messages and it works very well in all of my projects except one of them which has been working correctly all the time and I just wanted to add this custom Action here too but it gives me this error :
Instance of ChangeHotspotMethod couldn't be created. The the script class needs to derive from ScriptableObject.
UnityEngine.ScriptableObject:CreateInstance(String)
AC.AdventureCreator:RefreshActions() (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:480)
AC.AdventureCreator:OnEnable() (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:48)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
As I say this project is also short and is working as before by eliminating the custom Action. I have no idea whatsoever why.
Yes, of course and as I said the same script works with every other project perfectly and it doesn't show in Actions Manager specially because it disappears I have spent now 2 days and it looks worse because when I copy my 'ChangeHotspotSetting' from one of the working projects into this one even the Adventure Creator top menu in the Unity main screen disappears and so are its Editors!! even if I re-import or reload it from Asset Store it just doesn't show up at all. The only way to recoup is to delete the script, exit , re load the project and now I can see again Adventure Creator menu but no editors so I have to bring them from AC again and everything is fine. I have compared, Managers and use the same actor as 1st person as the other projects to no avail.
It's a mystery
FOUND IT !!
2 days ago I bought from Asset Store this: "Town Constructor Pack V2" and downloaded it ONLY in the project I've been having problems with. It created a series of errors having to do with there own included Standard Package competing with the Unity supplied one and creating duplicates plus a lot of other incomprehensible errors such as the disappearance of the AC menus.
That's the reason why my custom script worked with all my other projects because I did not import the Town Constructor Package into them.
I've had similar problems bringing packages from Asset Store which include scriopts related to the characters and others that collide with the AC .
For whoever buys this package (which is very nice specially for less than 5 €) just remove their entire Standard Package.