Forum rules - please read before posting.

"Play From Here" Functionality with Adventure Creator

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!

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.

  • edited April 23

    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:

    Download the script and save it as PlayFromHereInitData.cs in your Project. Then you can create a PlayFromHereData.asset at "Assets/ScriptableObjects/Editor/PlayFromHereData.asset" (or change the path in the script). Now just plug in all your player and manager objects and you're good to go!

    (...) Download the script and put it into any folder named "Editor" in your project. (It will also work if you put it in another folder, but your project won't build anymore)

  • There is a small typo error in the code.

    Good spot, thanks - I've corrected it.

    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:

    This one can be placed anywhere.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.