Forum rules - please read before posting.

Having a problem controlling where the player appears when switching scenes

edited November 2022 in Technical Q&A

I'm trying to make a "meanwhile..." cutscene, where from scene A the camera cuts to scene B, the engine plays some animations, and then we go back to scene A and the game continues.

I created my cutscene in a prefab so I took advantage of the "survive scene change" option. All works as intended except I'm having trouble controlling where the player appears during this cutscene, and at the end of it. The goal is to have the player teleported outside of the camera space while we're in scene B so it's not seen, and have it appear on the marker he was on initially when getting back to scene A, so it appears as it hasn't moved.

I have default playerStart markers for both scenes (they're adjacent to each other and the player can normally move between them), and for the life of me I can't find a way to avoid the player always appearing on each scene's playerStarts as if he was moving between them during normal gameplay.

I created a dedicated playerStart as a prefab called "PlayerStartCutscene" that I intend to use in both scenes to place the player where I need to, but can't find a way to do so. I tried experimenting with the option "position player relative to marker" in the scene switch action of the cutscene, but it isn't completely clear to me what it does exactly: in the first switch it doesn't seem to do anything, and in the switch back to A it teleports the player in a completely unrelated position. I didn't find any specific documentation on that option and I'm not sure if I need it at all in this scenario.

Comments

  • If you're switching scene in the normal way as part of the Cutscene, the Player will travel with it and be placed at the appropriate PlayerStart in the next scene.

    If you want the Player to remain where they are for its duration, the easiest approach is to rely on Player-switching, and switch to a different (invisible) Player that's in scene B.

    Note that this Player needn't ever be controlled in-game - it can just be used for the purpose of such cutscenes.

    Switching to a Player in another scene will load the scene but leave the previous Player where they are - so you can switch back to the regular Player afterwards to end the Cutscene.

    A tutorial on AC's Player-switching system can be found here.

  • ah! I would have never thought about that. thanks for the tip!

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.