Forum rules - please read before posting.

Following player doesn't spawn in specific conditions

edited February 7 in Technical Q&A

I ran into an issue that I'm not sure I can full diagnose, this will take some time to explain so please bear with me
I have a game with two players you can switch between at any time
The game starts with only one player and they reunite later
The inactive player always follows the active player using the NPC: Follow action (follow across scenes is enabled for this)
While testing I found out that sometimes the following player will not follow the active one to the next scene, however this is NOT due to the following player being left behind because if I switch to them they instantly spawn in the current scene instead of switching to the previous scene
I tried to pinpoint the issue in the code but I'm afraid it's above my paygrade, what I noticed is that the console message "Spawned instance of Player ''" DO NOT show up when the bug triggers
After a bit of testing I managed to find a way to always reproduce this, at least in my setup

  1. Switch to player 2
  2. Drop a save using player 2
  3. Restart the game so that you're using player 1
  4. Load the save
  5. Leave the scene into another scene
  6. Player 2 should be alone in the next scene

This also works with player 1, so for example I currently have Save 1 (Player 2) and Save 2 (Player 1), if I load Save 1 and leave the scene Player 2 will be alone, if I then go to Save 2 and leave Player 1 will be the one alone
If I leave this second scene (For example going back to the first scene) the other player will spawn normally, and it will not break again until I reload a save that was using a different character

Here's some things I tried
I have an OnFinishLoading Event that runs every time I load a save to change some UI stuff to reflect the current player
1. Tried adding a follow action on the inactive player -> No effect
2. Tried a Teleport Inactive Action -> the character is moved to it's starting position on load, and the problem still happens

I haven't tried to create a new project to see if this always happens yet, but I'm willing to privately share my source code and the savefiles necessary if it helps debugging because it might have to do with how I'm doing things
It's nothing too fancy but I have some ActionLists for the following things
1. Upon Switching characters the inactive character is given a NPC:Follow command
2. Sometimes I need to move both characters into a specific place for cutscens, I have an ActionList that sends a stop following command, move the characters and then re-issues the follow command

I am pretty confident these actionlists are not the cause because of what I mentioned above (the missing character is not in the previous scene)
I verified this further by manually issuing a Stop Following command on the inactive character, leaving the scene, then switching back, the game moved me back to the previous scene where I was able to move the character around, this does NOT happen when the bug triggers

Comments

  • What's your AC version?

    You mention this occuring sometimes - is there a pattern to when the issue occurs vs doesn't?

    I think I'd need to see your project myself to understand what's going on. If this is occuring in the latest release, PM me your files along with instructions on how to reliably recreate it upon import and I can take a look.

  • edited February 8

    @ChrisIceBox Latest Version (1.85.5), Unity version is 6000.2.6f2
    I found a way to reproduce the issue 100% of the time, it's the 6 step process with loading saves

    I can definitely send you the files, I just need some time to zip them up and upload them
    EDIT: Sent you a DM

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.