Forum rules - please read before posting.

Player Switch OnAfterChangeScene problem

I am trying to figure out how to change the default player, the best way I came up with was to switch the player in the "OnAfterChangeScene" Event. It seems to work fine until I skip the "OnStart" action in the scene. When I skip the "OnStart" action list, the default player comes out, while the the player I am trying to switch to shows up but cannot be controlled. Is switching player "OnAfterChangeScene" Event a big no no, or is this some kind of bug?

Comments

  • I'd need to know more specific details about the process. Do you have the "Player switching" setting enabled, or are you manually adding/removing Player objects?

    When using Player-switching, AC will switch to the newly-assigned Player's scene if it's not currently open. Typically, you'd set the Player's scene (with "Player: Teleport inactive") and then switch to that Player (with "Player: Switch"). AC would then take over the scene-switching automatically.

  • Yes, the Player switching is set to "allow" in the setting. I am using the player switching in the action list asset of the "OnAfterChangeScene" event. So basically switching the player before the scene is loaded? The reason why I am doing it this way and not after the scene is loaded is because at the momement when the player switches, there's no black screen, and then goes to black screen afterwards.

    Everything worked out this way until I skip the "OnStart" cutscene, and it spawns the default player on top of the switched player(cannot control).

  • I suspect it's a case of AC getting confused about your intent with the way you've set things up.

    I'm not 100% clear on your situation, but try putting the Player: Switch Action into the OnStart cutscene itself - don't have a separate OnAfterChangeScene ActionList that runs alongside it.

  • Yeah, that's likely the case. Putting it in the OnStart cutscene seems to fix this problem. Is there a way to keep the screen black when changing the players?

  • If the switch occurs in the same scene, you'd need to use Camera: Fade Actions to fade out/in instantly before and after.

  • The issue still persists. When the Player Switch action is placed in the OnStart cutscene and that cutscene is skipped, both the original and the switched players appear in the scene — but only the original player remains controllable.

  • I cannot reproduce the issue. Are you skipping before or after the switch occurs naturally?

    What are your AC/Unity versions, and can you provide steps to recreate from scratch? For testing, the New Game Wizard can be used to create a default 3D Sample Player, and then Tin Pot from the 3D Demo can be assigned as an additional Player prefab.

  • The Unity version is 2022.3.62f2, and the AC version is 1.84.3. In the OnStart cutscene, I’m simply using a Player Switch action followed by a short Wait. The issue is rare—occurring roughly 1 out of every 20 times—and seems to happen when I repeatedly press the skip button right as the scene starts. It appears to occur during the player switch process.

    https://drive.google.com/file/d/1xmPl94-s__c7f1YBQKLzXVI7Sni66II7/view?usp=sharing

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.