Hello,
I'm looking to improve my testing workflow in Unity with Adventure Creator. Currently, I'm using a debug mode with a marker that I have to constantly move around the scene to position my player character during testing. This is time-consuming and interrupts my creative flow.
I found a script called "Play From Here" on Reddit that allows right-clicking anywhere in the scene view to start the game with the player at that position. This would save me tons of time during development and testing.
I think it would be great if AC would include something like this. If not, could someone indicate how to integrate it with AC?
Thanks!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Nice find.
AC needs to run its own spawning code as part of its initialisation - so the script isn't directly compatible. However, I can see the general gist of how it works - I'll see if I can adapt it to move the Default PlayerStart.
Done - I've added it as a page on the wiki here:
https://adventure-creator.fandom.com/wiki/"Start_from_here"_Scene_view_option
Awesome!! It works great! Thanks!
There is a small typo error in the code.
The script has a naming mismatch error on line 21. The static constructor is incorrectly named PlayFromHere() but should match the class name StartFromHere. This creates a compiler error (CS1520: Method must have a return type) because the compiler interprets it as a method without a return type rather than a constructor.
To fix it, simply rename the static constructor from static PlayFromHere() to static StartFromHere().
Also, I don't know if this applies to the tweaked version of the script, and it was mentioned by the author of the original script:
Good spot, thanks - I've corrected it.
This one can be placed anywhere.