Hello!
Is it possible to create an Action Scene/Switch next (the opposite of Scene/Switch previous)? I tried to modify the script, but my ignorance of C# is devastating.
Could someone help me with that?
Thank you,
Suely
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
To clarify: the "Switch previous" command refers to the last-visited scene - not the next scene up in Unity's build settings.
But as for a custom Action, try this:
Thank you very much!
Sorry to bother you again, but I tried placing it in several folders (inclusing a Custom Actions folder) and keep getting a message saying that the script "must derive fro AC's Action class in order to be available as an Action".
Could you help me with this as well?
Thank you
Suely
The AC debug logger:
-> AC debug logger
UnityEngine.Debug:LogError (object,UnityEngine.Object)
AC.ACDebug:LogError (object,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:46)
AC.AdventureCreator:AddActionsFromFolder (AC.ActionsManager,string,System.Collections.Generic.List`1<AC.ActionType>) (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:590)
AC.AdventureCreator:RefreshActions () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:495)
AC.AdventureCreator:OnEnable () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:39)
Check that the script's filename matches the class, i.e. ActionSceneNext.cs, and make that the scripts inside the folder it's placed in are exclusively Action scripts.
Naming as your example did the trick, thank you!
As stated in the previous comment, the error message has been solved. However, the action does not run
I have tried with normal scene names ('start' and 'second') and naming with numbers ('1' and '2'). I have also tried creating another hotspot switching to the second scene by name and coming back to the first one, just in case.
No error message, though: it identifies the area as a hotspot (or button), but it is as if no action had been specified.
Try running the ActionList its placed in manually, by clicking "Run now" in its Inspector.
Are your scenes added to the build settings, and do any messages appear in the Console?
nope...
I have a second hotspot and button going to the next scene by name and they work. No error message either.
I placed a build here (B&W arrow uses the next scene name, button and white arrow use the next scene script) here https://drive.google.com/drive/folders/1xAe1P7CW4zIFjrKcaxs6dkMQW1OENyDF?usp=sharing in case you want to see it, but I suspect I should try to find alternatives.
I must apologise - it was a typo in the script.
I've amended it above, please give it another go.
It works!
No reason to apologize: you are the best!